From 4a5f6fef6b78f2784449b4460c18f31e62bbfb6b Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 2 Nov 2022 00:29:56 +0800 Subject: [PATCH] Update uninstall.sh --- scripts/uninstall.sh | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 7f01d48fa..6a244eb98 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -25,13 +25,14 @@ UNINSTALL_MySQL() echo -e "----------------------------------------------------" echo -e "检查已有MySQL环境,卸载可能影响现有站点及数据" echo -e "----------------------------------------------------" - echo -e "已知风险/输入yes强制卸载!" + echo -e "已知风险/输入yes强制卸载![yes/no]" read -p "输入yes强制卸载: " yes; if [ "$yes" != "yes" ];then echo -e "------------" echo "取消卸载MySQL" else cd /www/server/mdserver-web/plugins/mysql && sh install.sh uninstall 8.0 + echo "卸载MySQL成功!" fi fi } @@ -42,13 +43,14 @@ UNINSTALL_OP() echo -e "----------------------------------------------------" echo -e "检查已有OpenResty环境,卸载可能影响现有站点及数据" echo -e "----------------------------------------------------" - echo -e "已知风险/输入yes强制卸载!" + echo -e "已知风险/输入yes强制卸载![yes/no]" read -p "输入yes强制卸载: " yes; if [ "$yes" != "yes" ];then echo -e "------------" echo "取消卸载OpenResty" else cd /www/server/mdserver-web/plugins/openresty && sh install.sh uninstall + echo "卸载OpenResty成功!" fi fi } @@ -59,7 +61,7 @@ UNINSTALL_PHP() echo -e "----------------------------------------------------" echo -e "检查已有PHP环境,卸载可能影响现有站点及数据" echo -e "----------------------------------------------------" - read -p "输入yes强制卸载所有PHP: " yes; + read -p "输入yes强制卸载所有PHP[yes/no]: " yes; if [ "$yes" != "yes" ];then echo -e "------------" echo "取消卸载PHP" @@ -69,12 +71,29 @@ UNINSTALL_PHP() if [ -d /www/server/php/${PHP_VER} ];then cd /www/server/mdserver-web/plugins/php && bash install.sh uninstall ${PHP_VER} fi - echo "卸载PHP${PHP_VER}" + echo "卸载PHP${PHP_VER}成功!" done fi fi } +UNINSTALL_MEMCACHED() +{ + if [ -d /www/server/memcached ];then + echo -e "----------------------------------------------------" + echo -e "检查已有Memcached环境,卸载可能影响现有站点及数据" + echo -e "----------------------------------------------------" + read -p "输入yes强制卸载所有Memcached[yes/no]: " yes; + if [ "$yes" != "yes" ];then + echo -e "------------" + echo "取消卸载Memcached" + else + cd /www/server/mdserver-web/plugins/memcached && bash install.sh uninstall + echo "卸载Memcached成功" + fi + fi +} + UNINSTALL_MW() { read -p "输入yes强制卸载面板: " yes; @@ -86,6 +105,7 @@ UNINSTALL_MW() rm -rf /etc/init.d/mw systemctl daemon-reload rm -rf /www/server/mdserver-web + echo "卸载面板成功" fi }