parent
2da9d0fa34
commit
727b60d292
|
|
@ -11,12 +11,6 @@ path=/var/log
|
||||||
[[ ! -d ${path} ]] && mkdir -p ${path}
|
[[ ! -d ${path} ]] && mkdir -p ${path}
|
||||||
log=${path}/shadowsocks-crond.log
|
log=${path}/shadowsocks-crond.log
|
||||||
|
|
||||||
shadowsocks[0]=/usr/bin/ssserver
|
|
||||||
shadowsocks[1]=/usr/local/bin/ssserver
|
|
||||||
shadowsocks[2]=/usr/bin/shadowsocks-server
|
|
||||||
shadowsocks[3]=/usr/local/bin/ss-server
|
|
||||||
shadowsocks[4]=/usr/local/shadowsocks/server.py
|
|
||||||
|
|
||||||
shadowsocks_init[0]=/etc/init.d/shadowsocks
|
shadowsocks_init[0]=/etc/init.d/shadowsocks
|
||||||
shadowsocks_init[1]=/etc/init.d/shadowsocks-python
|
shadowsocks_init[1]=/etc/init.d/shadowsocks-python
|
||||||
shadowsocks_init[2]=/etc/init.d/shadowsocks-r
|
shadowsocks_init[2]=/etc/init.d/shadowsocks-r
|
||||||
|
|
@ -27,14 +21,9 @@ i=0
|
||||||
for init in ${shadowsocks_init[@]}; do
|
for init in ${shadowsocks_init[@]}; do
|
||||||
pid=""
|
pid=""
|
||||||
if [ -f ${init} ]; then
|
if [ -f ${init} ]; then
|
||||||
${init} status > /dev/null 2>&1
|
ss_status=`${init} status`
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
for bin in ${shadowsocks[@]}; do
|
pid=`echo $ss_status | sed 's/[^0-9]*//g'`
|
||||||
pid=`ps -ef | grep -v grep | grep -i "${bin}" | awk '{print $2}'`
|
|
||||||
if [ ! -z ${pid} ]; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z ${pid} ]; then
|
if [ -z ${pid} ]; then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user