From 03fa02318183704971997139ad62af691d2cb27f Mon Sep 17 00:00:00 2001 From: Teddysun Date: Sat, 10 May 2014 00:44:51 +0800 Subject: [PATCH] Fix uninstall function --- shadowsocks-libev.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shadowsocks-libev.sh b/shadowsocks-libev.sh index a210050..7553672 100644 --- a/shadowsocks-libev.sh +++ b/shadowsocks-libev.sh @@ -177,7 +177,10 @@ function install(){ # Uninstall Shadowsocks-libev function uninstall_shadowsocks_libev(){ - /etc/init.d/shadowsocks stop + ps -ef | grep -v grep | grep -v ps | grep -i ss-server > /dev/null 2>&1 + if [ $? -eq 0 ]; then + /etc/init.d/shadowsocks stop + fi # delete config file rm -f /etc/shadowsocks/config.json # delete shadowsocks @@ -187,6 +190,7 @@ function uninstall_shadowsocks_libev(){ rm -f /usr/local/bin/ss-redir rm -f /usr/local/share/man/man8/shadowsocks.8 rm -f /etc/init.d/shadowsocks + echo "Shadowsocks-libev uninstall success!" } # Initialization step