初探nginx 在RHEL5.4 平台上:
#Definition check listen conflict function check_listen(){echo -n "Checek $PROG Listen port status: "
NGINX_LISTEN=(`grep "^listen" ${NGINX_DIR}/conf/$PROG.conf | awk '{print $NF}' | cut -d";" -f1 | uniq`)
SYSTEM_LISTEN=(`netstat -tnl |awk '{print $4}' | grep | awk -F":" '{print $NF}' | uniq `)
for FIR in ${NGINX_LISTEN
[*]}; do
for SEC in ${SYSTEM_LISTEN
[*]};do
if [ $FIR == $SEC ]; then
echo "Has the listen port conflict, please check $PROG config file ${NGINX_DIR}/conf/$PROG.conf"
break
fi
done
done
echo "listen prot status OK!"
页:
[1]