From 78139430e90952366fe46f64e73c5aefe88cbffa Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 5 Jun 2020 17:41:53 +0800 Subject: [PATCH] Update shadowsocks.tpl --- plugins/shadowsocks/init.d/shadowsocks.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/shadowsocks/init.d/shadowsocks.tpl b/plugins/shadowsocks/init.d/shadowsocks.tpl index 80f2e2102..9fb194df4 100755 --- a/plugins/shadowsocks/init.d/shadowsocks.tpl +++ b/plugins/shadowsocks/init.d/shadowsocks.tpl @@ -15,14 +15,14 @@ ROOT_PATH={$SERVER_PATH} p_start(){ - isStart=$(ps -ef | grep shadowsocks | grep -v grep | awk '{print $2}') + isStart=$(ps -ef | grep shadowsocks | grep -v grep | grep -v 'init.d' | grep -v 'service' | awk '{print $2}') if [ "$isStart" == "" ];then echo -e "Starting shadowsocks... \c" ssserver -c $ROOT_PATH/shadowsocks/shadowsocks.json -d start sleep 0.3 - isStart=$(ps -ef | grep shadowsocks | grep -v grep | awk '{print $2}') + isStart=$(ps -ef | grep shadowsocks | grep -v grep | grep -v 'init.d' | grep -v 'service' | awk '{print $2}') if [ "$isStart" == '' ];then echo -e "\033[31mError: shadowsocks service startup failed.\033[0m" return; @@ -36,7 +36,7 @@ p_start(){ p_stop(){ echo -e "Stopping shadowsocks... \c"; - pids=$(ps -ef | grep shadowsocks | grep -v grep | awk '{print $2}') + pids=$(ps -ef | grep shadowsocks | grep -v grep | grep -v 'init.d' | grep -v 'service' | awk '{print $2}') arr=($pids) for p in ${arr[@]}