Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/plugins/openresty/install.sh

62 lines
1.7 KiB

7 years ago
#!/bin/bash
2 years ago
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
7 years ago
export PATH
5 months ago
# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4
# cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4
4 weeks ago
# cd /www/server/mdserver-web && python3 plugins/openresty/index.py run_info
7 years ago
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
2 years ago
sysName=`uname`
7 years ago
action=$1
type=$2
7 years ago
VERSION=$2
openrestyDir=${serverPath}/source/openresty
if id www &> /dev/null ;then
3 years ago
echo "www uid is `id -u www`"
echo "www shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd www
useradd -g www -s /bin/bash www
fi
10 months ago
if [ "${2}" == "" ];then
echo '缺少安装脚本版本...'
exit 0
fi
if [ "${action}" == "uninstall" ];then
if [ -f /usr/lib/systemd/system/openresty.service ] || [ -f /lib/systemd/system/openresty.service ];then
systemctl stop openresty
rm -rf /usr/systemd/system/openresty.service
rm -rf /lib/systemd/system/openresty.service
systemctl daemon-reload
fi
if [ -f $serverPath/openresty/init.d/openresty ];then
$serverPath/openresty/init.d/openresty stop
fi
rm -rf $serverPath/openresty
10 months ago
fi
10 months ago
sh -x $curPath/versions/$2/install.sh $1
10 months ago
if [ "${action}" == "install" ] && [ -d $serverPath/openresty ];then
10 months ago
echo "${VERSION}" > $serverPath/openresty/version.pl
mkdir -p $serverPath/web_conf/php/conf
echo 'set $PHP_ENV 0;' > $serverPath/web_conf/php/conf/enable-php-00.conf
#初始化
cd ${rootPath} && python3 ${rootPath}/plugins/openresty/index.py start
cd ${rootPath} && python3 ${rootPath}/plugins/openresty/index.py initd_install
fi