diff --git a/shadowsocks-libev-debian.sh b/shadowsocks-libev-debian.sh index 58089e6..18bfa0c 100644 --- a/shadowsocks-libev-debian.sh +++ b/shadowsocks-libev-debian.sh @@ -129,8 +129,10 @@ function install(){ if [ $? -ne 0 ]; then echo "nohup /usr/local/bin/ss-server -c /etc/shadowsocks/config.json > /dev/null 2>&1 &" >> /etc/rc.local fi - # Start shadowsocks + # Run shadowsocks in the background nohup /usr/local/bin/ss-server -c /etc/shadowsocks/config.json > /dev/null 2>&1 & + # Run success or not + ps -ef | grep -v grep | grep -v ps | grep -i '/usr/local/bin/ss-server' > /dev/null 2>&1 if [ $? -eq 0 ]; then echo "Shadowsocks-libev start success!" else diff --git a/shadowsocks-nodejs.sh b/shadowsocks-nodejs.sh index 0d14082..f1fa083 100644 --- a/shadowsocks-nodejs.sh +++ b/shadowsocks-nodejs.sh @@ -151,6 +151,8 @@ function install(){ # Run it in the background if [ -s /usr/local/bin/ssserver ]; then nohup ssserver -c /etc/config.json > /dev/null 2>&1 & + # Run success or not + ps -ef | grep -v grep | grep -v ps | grep -i 'node /usr/local/bin/ssserver' > /dev/null 2>&1 if [ $? -eq 0 ]; then echo "Shadowsocks-nodejs start success!" else diff --git a/shadowsocks.sh b/shadowsocks.sh index dbff0b5..9ee4ab7 100644 --- a/shadowsocks.sh +++ b/shadowsocks.sh @@ -135,7 +135,10 @@ function install(){ pip install gevent pip install shadowsocks if [ -f /usr/bin/ssserver ]; then + # Run shadowsocks in the background nohup ssserver -c /etc/config.json > /dev/null 2>&1 & + # Run success or not + ps -ef | grep -v grep | grep -v ps | grep -i '/usr/bin/python /usr/bin/ssserver' > /dev/null 2>&1 if [ $? -eq 0 ]; then echo "Shadowsocks start success!" else