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/versions/1.13.6/install.sh

46 lines
1.1 KiB

7 years ago
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
6 years ago
install_tmp=${rootPath}/tmp/mw_install.pl
7 years ago
openrestyDir=${serverPath}/source/openresty
Install_openresty()
{
mkdir -p ${openrestyDir}
echo '正在安装脚本文件...' > $install_tmp
if [ ! -f ${openrestyDir}/openresty-1.13.6.2.tar.gz ];then
wget -O ${openrestyDir}/openresty-1.13.6.2.tar.gz https://openresty.org/download/openresty-1.13.6.2.tar.gz
fi
7 years ago
7 years ago
cd ${openrestyDir} && tar -zxvf openresty-1.13.6.2.tar.gz
7 years ago
cd ${openrestyDir}/openresty-1.13.6.2 && ./configure --prefix=$serverPath/openresty \
6 years ago
--with-http_v2_module \
7 years ago
--with-openssl=$serverPath/source/lib/openssl-1.0.2q \
6 years ago
--with-http_stub_status_module \
&& make && make install && \
7 years ago
echo '1.13.6' > $serverPath/openresty/version.pl
7 years ago
7 years ago
echo '安装完成' > $install_tmp
}
Uninstall_openresty()
{
rm -rf $serverPath/openresty
echo '卸载完成' > $install_tmp
}
action=$1
if [ "${1}" == 'install' ];then
Install_openresty
else
Uninstall_openresty
fi