重启脚本:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/bin/bash
PID=`
cat
/usr/local/nginx/logs/nginx
.pid` >
/dev/null
2>&1
case
$1
in
start)
/usr/local/nginx/sbin/nginx
;;
stop)
kill
-TERM $PID
;;
quit)
kill
-QUIT $PID
;;
reload)
kill
-HUP $PID
;;
restart)
kill
-TERM $PID
/usr/local/nginx/sbin/nginx
;;
status)
elinks http:
//localhost
-dump >
/dev/null
2>&1
if
[ $? -
ne
0 ];
then
echo
"nginx stop"
else
echo
"nginx running"
fi
esac
|
本文转自 wpf926 51CTO博客,原文链接:http://blog.51cto.com/wupengfei/1958135,如需转载请自行联系原作者