From cbf3a15bf09e8168e8a6bacbd87829dd998d20ef Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sun, 19 May 2024 22:06:47 +0800 Subject: [PATCH] update --- plugins/redis/install.sh | 23 ++++++++++++++--------- plugins/sphinx/install.sh | 7 +++---- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/plugins/redis/install.sh b/plugins/redis/install.sh index 22b40fd23..444726156 100755 --- a/plugins/redis/install.sh +++ b/plugins/redis/install.sh @@ -25,14 +25,16 @@ Install_App() { echo '正在安装脚本文件...' > $install_tmp mkdir -p $serverPath/source + mkdir -p $serverPath/source/redis - if [ ! -f $serverPath/source/redis-${VERSION}.tar.gz ];then - wget -O $serverPath/source/redis-${VERSION}.tar.gz http://download.redis.io/releases/redis-${VERSION}.tar.gz + FILE_TGZ=redis-${VERSION}.tar.gz + REDIS_DIR=$serverPath/source/redis + + if [ ! -f $REDIS_DIR/${FILE_TGZ} ];then + wget -O $REDIS_DIR/${FILE_TGZ} http://download.redis.io/releases/${FILE_TGZ} fi - cd $serverPath/source && tar -zxvf redis-${VERSION}.tar.gz - - + cd $REDIS_DIR && tar -zxvf ${FILE_TGZ} CMD_MAKE=`which gmake` if [ "$?" == "0" ];then @@ -55,8 +57,8 @@ Install_App() echo '安装失败!' fi - if [ -d $serverPath/source/redis-${VERSION} ];then - rm -rf $serverPath/source/redis-${VERSION} + if [ -d ${REDIS_DIR}/redis-${VERSION} ];then + rm -rf ${REDIS_DIR}/redis-${VERSION} fi } @@ -80,8 +82,11 @@ Uninstall_App() $serverPath/redis/initd/redis stop fi - rm -rf $serverPath/redis - echo "Uninstall_redis" > $install_tmp + if [ -d $serverPath/redis ];then + rm -rf $serverPath/redis + fi + + echo "卸载redis成功" } action=$1 diff --git a/plugins/sphinx/install.sh b/plugins/sphinx/install.sh index 32ba62636..054761d46 100755 --- a/plugins/sphinx/install.sh +++ b/plugins/sphinx/install.sh @@ -18,8 +18,7 @@ install_tmp=${rootPath}/tmp/mw_install.pl # /Users/midoks/Desktop/mwdev/server/sphinx/bin/bin/indexer /Users/midoks/Desktop/mwdev/server/sphinx/sphinx.conf 99cms_mc_comic --rotate bash ${rootPath}/scripts/getos.sh -echo "bash ${rootPath}/scripts/getos.sh" - +# echo "bash ${rootPath}/scripts/getos.sh" OSNAME="macos" if [ -f ${rootPath}/data/osname.pl ];then OSNAME=`cat ${rootPath}/data/osname.pl` @@ -139,12 +138,12 @@ Uninstall_sphinx() systemctl daemon-reload fi - echo "$serverPath/sphinx/initd/sphinx" if [ -f $serverPath/sphinx/initd/sphinx ];then $serverPath/sphinx/initd/sphinx stop fi - if [ -f $serverPath/sphinx ];then + if [ -d $serverPath/sphinx ];then + echo "rm -rf $serverPath/sphinx" rm -rf $serverPath/sphinx fi