From 5d7f61e4bc24db0aea000feec6643f7ba7746cbf Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 29 Jun 2022 03:03:35 +0800 Subject: [PATCH] =?UTF-8?q?redis=20=E5=AE=89=E8=A3=85=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/php/install.sh | 6 ++---- plugins/redis/install.sh | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/plugins/php/install.sh b/plugins/php/install.sh index 564da5f0d..b3a6f2f95 100755 --- a/plugins/php/install.sh +++ b/plugins/php/install.sh @@ -32,12 +32,10 @@ if [ ! -d $curPath/versions/$2 ];then fi if [ "${action}" == "uninstall" ];then - #初始化 - cd ${rootPath} && python3 ${rootPath}/plugins/php/index.py stop ${type} - cd ${rootPath} && python3 ${rootPath}/plugins/php/index.py initd_uninstall ${type} - + if [ -f /lib/systemd/system/php${type}.service ];then systemctl stop php${type} + systemctl disable php${type} rm -rf /lib/systemd/system/php${type}.service systemctl daemon-reload fi diff --git a/plugins/redis/install.sh b/plugins/redis/install.sh index 8404c0e5b..d19ffd750 100755 --- a/plugins/redis/install.sh +++ b/plugins/redis/install.sh @@ -28,18 +28,30 @@ Install_redis() cd redis-${VERSION} && make PREFIX=$serverPath/redis install sed '/^ *#/d' redis.conf > $serverPath/redis/redis.conf - echo "${VERSION}" > $serverPath/redis/version.pl + if [ -d $serverPath/redis ];then + echo "${VERSION}" > $serverPath/redis/version.pl + echo '安装完成' > $install_tmp - echo '安装完成' > $install_tmp + + cd ${rootPath} && python3 ${rootPath}/plugins/redis/index.py start + cd ${rootPath} && python3 ${rootPath}/plugins/redis/index.py initd_install + fi } Uninstall_redis() { - rm -rf $serverPath/redis - if [ -f /lib/systemd/system/redis.service ];then + systemctl stop redis + systemctl disable redis rm -rf /lib/systemd/system/redis.service + systemctl daemon-reload fi + + if [ -f $serverPath/redis/initd/redis ];then + $serverPath/redis/initd/redis stop + fi + + rm -rf $serverPath/redis echo "Uninstall_redis" > $install_tmp }