Add uninstall confirm dialog

This commit is contained in:
Teddysun 2014-05-30 10:15:43 +08:00
parent 3f446c9b94
commit 8f5359c0d8

View File

@ -189,6 +189,10 @@ function install(){
# Uninstall Shadowsocks-nodejs
function uninstall_shadowsocks_nodejs(){
printf "Are you sure uninstall Shadowsocks-nodejs? (y/n) : "
read answer
printf "\n"
if [ "$answer" = "y" ]; then
NODE_PID=`ps -ef | grep -v grep | grep -v ps | grep -i '/usr/local/bin/ssserver' | awk '{print $2}'`
if [ ! -z $NODE_PID ]; then
for pid in $NODE_PID
@ -210,6 +214,9 @@ function uninstall_shadowsocks_nodejs(){
mv /etc/rc.d/rc.local.bak /etc/rc.d/rc.local
fi
echo "Shadowsocks-nodejs uninstall success!"
else
echo "uninstall cancelled, Nothing to do"
fi
}
# Initialization step