Add uninstall confirm dialog
This commit is contained in:
parent
3f446c9b94
commit
8f5359c0d8
|
|
@ -189,6 +189,10 @@ function install(){
|
||||||
|
|
||||||
# Uninstall Shadowsocks-nodejs
|
# Uninstall Shadowsocks-nodejs
|
||||||
function 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}'`
|
NODE_PID=`ps -ef | grep -v grep | grep -v ps | grep -i '/usr/local/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
|
||||||
|
|
@ -210,6 +214,9 @@ function uninstall_shadowsocks_nodejs(){
|
||||||
mv /etc/rc.d/rc.local.bak /etc/rc.d/rc.local
|
mv /etc/rc.d/rc.local.bak /etc/rc.d/rc.local
|
||||||
fi
|
fi
|
||||||
echo "Shadowsocks-nodejs uninstall success!"
|
echo "Shadowsocks-nodejs uninstall success!"
|
||||||
|
else
|
||||||
|
echo "uninstall cancelled, Nothing to do"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Initialization step
|
# Initialization step
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user