mdserver-web/plugins/clean/install.sh

43 lines
930 B
Bash
Raw Permalink Normal View History

2021-11-23 03:22:08 -05:00
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/mongodb && /bin/bash install.sh install 5.0.4
# cd /www/server/mdserver-web/plugins/mongodb && /bin/bash install.sh install 5.0.4
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
VERSION=$2
2022-10-02 03:05:13 -04:00
if [ -f ${rootPath}/bin/activate ];then
source ${rootPath}/bin/activate
fi
2021-11-23 03:22:08 -05:00
Install_app()
{
2024-11-30 08:44:09 -05:00
echo '正在安装脚本文件...'
2021-11-23 03:22:08 -05:00
mkdir -p $serverPath/clean
2022-10-02 03:05:13 -04:00
cd ${rootPath} && python3 ${rootPath}/plugins/clean/index.py start
2021-11-23 03:22:08 -05:00
echo "${VERSION}" > $serverPath/clean/version.pl
2024-11-30 08:44:09 -05:00
echo '安装完成'
2021-11-23 03:22:08 -05:00
}
Uninstall_app()
{
2022-10-02 03:05:13 -04:00
cd ${rootPath} && python3 ${rootPath}/plugins/clean/index.py stop
2021-11-23 03:22:08 -05:00
rm -rf $serverPath/clean
2024-11-30 08:44:09 -05:00
echo "Uninstall_clean"
2021-11-23 03:22:08 -05:00
}
action=$1
if [ "${1}" == 'install' ];then
Install_app
else
Uninstall_app
fi