-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.sh
executable file
·40 lines (37 loc) · 905 Bytes
/
nginx.sh
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
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
if [ $# -eq 0 ];then
echo "please input the argument: "
echo " start -----> start the nginx"
echo " stop -----> stop the nginx"
echo " reload -----> reload the nginx"
exit 1
fi
case $1 in
start)
sudo /usr/local/nginx/sbin/nginx
if [ $? -eq 0 ];then
echo "nginx start success ..."
else
echo "nginx start fail ..."
fi
;;
stop)
sudo /usr/local/nginx/sbin/nginx -s quit
if [ $? -eq 0 ];then
echo "nginx stop success ..."
else
echo "nginx stop fail ..."
fi
;;
reload)
sudo /usr/local/nginx/sbin/nginx -s reload
if [ $? -eq 0 ];then
echo "nginx reload success ..."
else
echo "nginx reload fail ..."
fi
;;
*)
echo "do nothing ..."
;;
esac