nginx开机启动脚本
#!/bin/sh #nginx start stop restart reload #by zkg 2019-08-13 #chkconfig: 2345 32 62 #description: nginx is http server #system functions [ -f /etc/init.d/functions ] && . /etc/init.d/functions #Define variables PIDFILE=/data/nginx/logs/nginx.pid SRC_PWD=/data/nginx/sbin RETVAL=0 #Define functions Usage(){ echo "Usage:sh $0 {start|stop|restart|reload}" exit 1 } StartNginx(){ if [ ! -f $PIDFILE ];then echo "nginx is NOT running..." [ -x $SRC_PWD/nginx ]||exit 1 $SRC_PWD/nginx &>/dev/null RETVAL=$? if [ -f $PIDFILE ];then action "nginx is started" /bin/true else action "nginx is started" /bin