Fix uninstall function

This commit is contained in:
Teddysun 2014-05-13 20:18:58 +08:00
parent aa53cd0474
commit 5bbe00048a

View File

@ -170,7 +170,16 @@ function install(){
# Uninstall Shadowsocks # Uninstall Shadowsocks
function uninstall_shadowsocks(){ function uninstall_shadowsocks(){
killall ssserver NODE_PID=`ps -ef | grep -v grep | grep -v ps | grep -i 'ssserver' | awk '{print $2}'`
if [ ! -z $NODE_PID ]; then
for pid in $NODE_PID
do
kill -9 $pid
if [ $? -eq 0 ]; then
echo "Shadowsocks process[$pid] has been killed"
fi
done
fi
# delete config file # delete config file
rm -f /etc/config.json rm -f /etc/config.json
pip uninstall -y shadowsocks pip uninstall -y shadowsocks