-
Notifications
You must be signed in to change notification settings - Fork 10
/
cil.sh
executable file
·33 lines (31 loc) · 900 Bytes
/
cil.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
#!/usr/bin/env bash
if [ "x$(whoami)" != "xroot" ]; then
echo "Only root can run this script."
exit 1
fi
case $1 in
"start")
if [ -e /run/dshadowsocks.pid ] ;then
supervisorctl -c /opt/shadowsocks/supervisord.conf restart dshadowsocks
else
supervisord -c /opt/shadowsocks/supervisord.conf
fi
exit ${ret}
;;
"stop")
if [ -e /run/dshadowsocks.pid ] ;then
supervisorctl -c /opt/shadowsocks/supervisord.conf stop dshadowsocks && supervisorctl -c /opt/shadowsocks/supervisord.conf shutdown
fi
;;
"restart")
if [ -e /run/dshadowsocks.pid ] ;then
supervisorctl -c /opt/shadowsocks/supervisord.conf restart dshadowsocks
else
$0 start
fi
;;
*)
echo "usage: $(basename $0) {start|stop|restart}"
exit 1
;;
esac