Nginx 启动、停止、重启的脚本

2015-01-11 0 739
Nginx 启动、停止、重启的脚本
#!/bin/sh
# chkconfig: 345 86 14
# description: 启动,重启,停止nginx的shell脚本
NGINX_DIR=/opt/ngx
export NGINX_DIR

case $1 in
'start' )
echo "Starting nginx..."
$NGINX_DIR/sbin/nginx
;;
'reload' )
echo "Reload nginx configuration..."
kill -HUP `cat $NGINX_DIR/logs/nginx.pid`
;;
'stop' )
echo "Stopping nginx..."
kill -15 `cat $NGINX_DIR/logs/nginx.pid`
;;
'list' )
ps aux | egrep '(PID|nginx)'
;;
'testconfig' )
$NGINX_DIR/sbin/nginx -t
;;
*)
echo "usage: `basename $0` {start|reload|stop|list|testconfig}"
esac

遇见资源网 shell Nginx 启动、停止、重启的脚本 http://www.ox520.com/16812.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务