Add uninstall confirm dialog

This commit is contained in:
Teddysun 2014-05-30 10:08:31 +08:00
parent a9ecf67b5e
commit 5afb9cc4ad

View File

@ -177,6 +177,10 @@ function install(){
# Uninstall Shadowsocks-libev # Uninstall Shadowsocks-libev
function uninstall_shadowsocks_libev(){ function uninstall_shadowsocks_libev(){
printf "Are you sure uninstall shadowsocks_libev? (y/n) : "
read answer
printf "\n"
if [ "$answer" = "y" ]; then
ps -ef | grep -v grep | grep -v ps | grep -i "ss-server" > /dev/null 2>&1 ps -ef | grep -v grep | grep -v ps | grep -i "ss-server" > /dev/null 2>&1
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
/etc/init.d/shadowsocks stop /etc/init.d/shadowsocks stop
@ -192,6 +196,9 @@ function uninstall_shadowsocks_libev(){
rm -f /usr/local/share/man/man8/shadowsocks.8 rm -f /usr/local/share/man/man8/shadowsocks.8
rm -f /etc/init.d/shadowsocks rm -f /etc/init.d/shadowsocks
echo "Shadowsocks-libev uninstall success!" echo "Shadowsocks-libev uninstall success!"
else
echo "uninstall cancelled, Nothing to do"
fi
} }
# Initialization step # Initialization step