@panzhc 现在写好了 不太理解。 if /usr/local/nginx/sbin/nginx -t >/dev/null 2>&1; then echo "nginx configure file ok"
if /etc/init.d/nginx status >/dev/null 2>&1; then echo "nginx running" /etc/init.d/nginx reload else echo "nginx is stop" /etc/init.d/nginx stop /etc/init.d/nginx start exit fi