Nginx服务启动脚本

#!/bin/bash
#chkconfig:2345 99 20
PROG="/usr/local/nginx/sbin/nginx"
PIDF="/usr/local/nginx/logs/nginx.pid"

case "$1" in
start)
        $PROG
;;
stop)
        kill -s QUIT $(cat $PIDF)
;;
restart)
        $0 stop
        $0 start
;;
reload)
        kill -s HUP $(cat $PIDF)
;;
*)
        echo "Usage:$0{start|stop|restart|reload}"
        exit 1
esac
exit 0

posted @ 2019-05-18 10:03  #赵程#  阅读(107)  评论(0编辑  收藏  举报