diff --git a/plugins/openresty/info.json b/plugins/openresty/info.json index e999951ea..5bbabf102 100755 --- a/plugins/openresty/info.json +++ b/plugins/openresty/info.json @@ -11,6 +11,6 @@ "home":"http://openresty.org", "date":"2017-11-24", "pid": "1", - "versions": ["1.11.2", "1.13.6"], - "updates": ["1.11.2.5", "1.13.6.2"] + "versions": ["1.11.2.5", "1.13.6.2","1.15.8.3 "], + "updates": ["1.11.2.5", "1.13.6.2","1.15.8.3 "] } \ No newline at end of file diff --git a/plugins/openresty/install.sh b/plugins/openresty/install.sh index 9c7136a88..936354808 100755 --- a/plugins/openresty/install.sh +++ b/plugins/openresty/install.sh @@ -29,4 +29,4 @@ if [ ! -d $curPath/versions/$2 ];then exit 0 fi -sh -x $curPath/versions/$2/install.sh $1 +sh -x $curPath/versions/install.sh $1 diff --git a/plugins/openresty/versions/install.sh b/plugins/openresty/versions/install.sh new file mode 100755 index 000000000..206081793 --- /dev/null +++ b/plugins/openresty/versions/install.sh @@ -0,0 +1,49 @@ +#!/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") + + +VERSION=$1 + +install_tmp=${rootPath}/tmp/mw_install.pl +openrestyDir=${serverPath}/source/openresty + +Install_openresty() +{ + mkdir -p ${openrestyDir} + echo '正在安装脚本文件...' > $install_tmp + + if [ ! -f ${openrestyDir}/openresty-${VERSION}.tar.gz ];then + wget -O ${openrestyDir}/openresty-1.11.2.5.tar.gz https://openresty.org/download/openresty-${VERSION}.tar.gz + fi + + + cd ${openrestyDir} && tar -zxvf openresty-${VERSION}.tar.gz + + cd ${openrestyDir}/openresty-${VERSION} && ./configure --prefix=$serverPath/openresty \ + --with-http_v2_module \ + --with-openssl=$serverPath/source/lib/openssl-1.0.2q \ + --with-http_stub_status_module && make && make install && \ + echo "${VERSION}" > $serverPath/openresty/version.pl + + + echo '安装完成' > $install_tmp +} + +Uninstall_openresty() +{ + rm -rf $serverPath/openresty + echo '卸载完成' > $install_tmp +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_openresty +else + Uninstall_openresty +fi