重启脚本
#!/bin/bash
pid=`ps -ef |grep nginx|grep -v grep|grep master|awk '{print $2}'`
echo $pid
if [ -z $pid ];then
echo "Nginx is not running!"
else
echo "NOW!shutdown the nginx"
kill $pid
sleep 1;
echo " "
echo "Now!start the nginx"
/usr/local/nginx/sbin/nginx
fi