nginx自启动脚本 本文共有1095个字,关键词: ``` #!/bin/bash #chkconfig: 2345 99 33 #description: nginx server control tools ngxc="/usr/local/nginx/sbin/nginx" pidf="usr/local/nginx/logs/nginx.pid" ngxc_fpm="/usr/local/php/sbin/php-fpm" pidf_fpm="/usr/local/php/var/run/php-fpm.pid" case "$1" in start) $ngxc -t &> /dev/null if [ $? -eq 0 ];then $ngxc $ngxc_fpm echo "nginx service start success!" else $ngxc -t fi ;; stop) kill -s QUIT $(cat $pidf) kill -s QUIT $(cat $pidf_fpm) echo "nginx service stop success!" ;; restart) $0 stop $0 start ;; reload) $ngxc -t &> /dev/null if [ $? -eq 0 ];then kill -s HUP $(cat $pidf) kill -s HUP $(cat $pidf_fpm) echo "reload nginx config success!" else $ngxc -t fi ;; *) echo "please input stop|start|restart|reload." exit 1 esac ``` 「一键投喂 软糖/蛋糕/布丁/牛奶/冰阔乐!」 赞赏 × 几人行 (๑>ڡ<)☆谢谢老板~ 2元 5元 10元 50元 100元 任意金额 2元 使用微信扫描二维码完成支付 版权声明:本文为作者原创,如需转载须联系作者本人同意,未经作者本人同意不得擅自转载。 shell脚本 2017-03-20 评论 2619 次浏览