Add uninstall confirm default input

This commit is contained in:
Teddysun 2014-05-30 10:56:19 +08:00
parent 8f5359c0d8
commit 8b6b1a6165
4 changed files with 17 additions and 5 deletions

View File

@ -164,8 +164,11 @@ 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) : " printf "Are you sure uninstall Shadowsocks-libev? (y/n) : "
read answer
printf "\n" printf "\n"
read -p "(Default: n):" answer
if [ -z $answer ]; then
answer="n"
fi
if [ "$answer" = "y" ]; then if [ "$answer" = "y" ]; then
NODE_PID=`ps -ef | grep -v grep | grep -v ps | grep -i '/usr/local/bin/ss-server' | awk '{print $2}'` NODE_PID=`ps -ef | grep -v grep | grep -v ps | grep -i '/usr/local/bin/ss-server' | awk '{print $2}'`
if [ ! -z $NODE_PID ]; then if [ ! -z $NODE_PID ]; then

View File

@ -178,8 +178,11 @@ 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) : " printf "Are you sure uninstall shadowsocks_libev? (y/n) : "
read answer
printf "\n" printf "\n"
read -p "(Default: n):" answer
if [ -z $answer ]; then
answer="n"
fi
if [ "$answer" = "y" ]; then 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

View File

@ -190,8 +190,11 @@ 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) : " printf "Are you sure uninstall Shadowsocks-nodejs? (y/n) : "
read answer
printf "\n" printf "\n"
read -p "(Default: n):" answer
if [ -z $answer ]; then
answer="n"
fi
if [ "$answer" = "y" ]; then 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

View File

@ -173,9 +173,12 @@ function install(){
# Uninstall Shadowsocks # Uninstall Shadowsocks
function uninstall_shadowsocks(){ function uninstall_shadowsocks(){
printf "Are you sure uninstall Shadowsocks? (y/n) : " printf "Are you sure uninstall Shadowsocks? (y/n) "
read answer
printf "\n" printf "\n"
read -p "(Default: n):" answer
if [ -z $answer ]; then
answer="n"
fi
if [ "$answer" = "y" ]; then 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