Add uninstall confirm dialog

This commit is contained in:
Teddysun 2014-05-30 10:14:46 +08:00
parent 5afb9cc4ad
commit 3eab56d528

View File

@ -173,6 +173,10 @@ function install(){
# Uninstall Shadowsocks # Uninstall Shadowsocks
function uninstall_shadowsocks(){ function uninstall_shadowsocks(){
printf "Are you sure uninstall Shadowsocks? (y/n) : "
read answer
printf "\n"
if [ "$answer" = "y" ]; then
NODE_PID=`ps -ef | grep -v grep | grep -v ps | grep -i '/usr/bin/python /usr/bin/ssserver' | awk '{print $2}'` NODE_PID=`ps -ef | grep -v grep | grep -v ps | grep -i '/usr/bin/python /usr/bin/ssserver' | awk '{print $2}'`
if [ ! -z $NODE_PID ]; then if [ ! -z $NODE_PID ]; then
for pid in $NODE_PID for pid in $NODE_PID
@ -193,6 +197,9 @@ function uninstall_shadowsocks(){
else else
echo "Shadowsocks uninstall failed!" echo "Shadowsocks uninstall failed!"
fi fi
else
echo "uninstall cancelled, Nothing to do"
fi
} }
# Initialization step # Initialization step