parent
97b1e8b9b3
commit
c9e27c2add
|
|
@ -108,6 +108,8 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
|
|||
* nezha保存优化。
|
||||
* OP防火墙优化(站点配置-状态关闭后,不再防御)-已安装的,需要重载。
|
||||
* 修复子目录绑定-伪静态问题。
|
||||
* [插件]docker - 添加IP地址池。
|
||||
* PHP下载中国优化。
|
||||
|
||||
### JSDelivr安装地址
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
<p onclick="pluginInitD('docker');">自启动</p>
|
||||
<p onclick="dockerConList();">容器列表</p>
|
||||
<p onclick="dockerImageList();">镜像列表</p>
|
||||
<p onclick="dockerIpList();">IP地址池</p>
|
||||
<p onclick="repoList();">仓库</p>
|
||||
</div>
|
||||
<div class="bt-w-con pd15">
|
||||
|
|
|
|||
|
|
@ -443,7 +443,7 @@ def dockerLoginCheck(user_name, user_pass, registry):
|
|||
return False
|
||||
|
||||
|
||||
def getDockerIpList():
|
||||
def getDockerIpListData():
|
||||
# 取IP列表
|
||||
path = getServerDir()
|
||||
ipConf = path + '/iplist.json'
|
||||
|
|
@ -453,13 +453,63 @@ def getDockerIpList():
|
|||
return iplist
|
||||
|
||||
|
||||
def getDockerIpList():
|
||||
data = getDockerIpListData()
|
||||
return mw.returnJson(True, 'ok!', data)
|
||||
|
||||
|
||||
def dockerAddIP():
|
||||
# 添加IP
|
||||
args = getArgs()
|
||||
data = checkArgs(args, ['address', 'netmask', 'gateway'])
|
||||
if not data[0]:
|
||||
return data[1]
|
||||
|
||||
path = getServerDir()
|
||||
ipConf = path + '/iplist.json'
|
||||
if not os.path.exists(ipConf):
|
||||
iplist = []
|
||||
mw.writeFile(ipConf, json.dumps(iplist))
|
||||
|
||||
iplist = json.loads(mw.readFile(ipConf))
|
||||
ipInfo = {
|
||||
'address': args['address'],
|
||||
'netmask': args['netmask'],
|
||||
'gateway': args['gateway'],
|
||||
}
|
||||
iplist.append(ipInfo)
|
||||
mw.writeFile(ipConf, json.dumps(iplist))
|
||||
return mw.returnJson(True, '添加成功!')
|
||||
|
||||
|
||||
def dockerDelIP():
|
||||
# 删除IP
|
||||
args = getArgs()
|
||||
data = checkArgs(args, ['address'])
|
||||
if not data[0]:
|
||||
return data[1]
|
||||
|
||||
path = getServerDir()
|
||||
ipConf = path + '/iplist.json'
|
||||
if not os.path.exists(ipConf):
|
||||
return mw.returnJson(False, '指定的IP不存在。!')
|
||||
iplist = json.loads(mw.readFile(ipConf))
|
||||
newList = []
|
||||
for ipInfo in iplist:
|
||||
if ipInfo['address'] == args['address']:
|
||||
continue
|
||||
newList.append(ipInfo)
|
||||
mw.writeFile(ipConf, json.dumps(newList))
|
||||
return mw.returnJson(True, '成功删除!')
|
||||
|
||||
|
||||
def getDockerCreateInfo():
|
||||
# 取创建依赖
|
||||
import psutil
|
||||
data = {}
|
||||
data['images'] = imageList()
|
||||
data['memSize'] = int(psutil.virtual_memory().total / 1024 / 1024)
|
||||
data['iplist'] = getDockerIpList()
|
||||
data['iplist'] = getDockerIpListData()
|
||||
return mw.returnJson(True, 'ok!', data)
|
||||
|
||||
|
||||
|
|
@ -653,6 +703,12 @@ if __name__ == "__main__":
|
|||
print(dockerPullReg())
|
||||
elif func == 'image_list':
|
||||
print(imageListData())
|
||||
elif func == 'docker_get_iplist':
|
||||
print(getDockerIpList())
|
||||
elif func == 'docker_del_ip':
|
||||
print(dockerDelIP())
|
||||
elif func == 'docker_add_ip':
|
||||
print(dockerAddIP())
|
||||
elif func == 'get_docker_create_info':
|
||||
print(getDockerCreateInfo())
|
||||
elif func == 'docker_create_con':
|
||||
|
|
|
|||
|
|
@ -468,7 +468,7 @@ function pullImages(tag, id){
|
|||
function dockerImageListRender(){
|
||||
dPost('image_list', '', {}, function(rdata){
|
||||
var rdata = $.parseJSON(rdata.data);
|
||||
console.log(rdata);
|
||||
// console.log(rdata);
|
||||
if (!rdata.status){
|
||||
layer.msg(rdata.msg,{icon:2,time:2000});
|
||||
return;
|
||||
|
|
@ -634,6 +634,87 @@ function dockerImageList(){
|
|||
dockerImageListRender();
|
||||
}
|
||||
|
||||
function deleteIpList(address){
|
||||
safeMessage('删除IP','你将删除从IP地址池['+address+'],确定?',function(){
|
||||
dPost('docker_del_ip','', {address:address},function(rdata){
|
||||
var rdata = $.parseJSON(rdata.data);
|
||||
showMsg(rdata.msg,function(){
|
||||
if(rdata.status) {
|
||||
dockerIpListRender();
|
||||
}
|
||||
},{ icon: rdata.status ? 1 : 2 });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function dockerIpListRender(){
|
||||
dPost('docker_get_iplist', '', {}, function(rdata){
|
||||
var rdata = $.parseJSON(rdata.data);
|
||||
// console.log(rdata);
|
||||
if (!rdata.status){
|
||||
layer.msg(rdata.msg,{icon:2,time:2000});
|
||||
return;
|
||||
}
|
||||
|
||||
var list = '';
|
||||
var rlist = rdata.data;
|
||||
|
||||
for (var i = 0; i < rlist.length; i++) {
|
||||
|
||||
var op = '';
|
||||
op += '<a href="javascript:;" onclick="deleteIpList(\''+rlist[i]['address']+'\')" class="btlink">删除</a>';
|
||||
|
||||
list += '<tr>';
|
||||
list += '<td>'+rlist[i]['address']+'</td>';
|
||||
list += '<td>'+rlist[i]['netmask']+'</td>';
|
||||
list += '<td>'+rlist[i]['gateway']+'</td>';
|
||||
list += '<td class="text-right">'+op+'</td>';
|
||||
list += '</tr>';
|
||||
}
|
||||
|
||||
$('#ip_list tbody').html(list);
|
||||
});
|
||||
}
|
||||
|
||||
function dockerAddIpPool(){
|
||||
var address = $('input[name="address"]').val();
|
||||
var netmask = $('input[name="netmask"]').val();
|
||||
var gateway = $('input[name="gateway"]').val();
|
||||
dPost('docker_add_ip','', {address:address,netmask:netmask,gateway:gateway}, function(rdata){
|
||||
var rdata = $.parseJSON(rdata.data);
|
||||
showMsg(rdata.msg, function(){
|
||||
dockerIpListRender();
|
||||
},{icon:rdata.status?1:2})
|
||||
});
|
||||
}
|
||||
|
||||
function dockerIpList(){
|
||||
var con = '<div class="safe bgw">\
|
||||
<div class="search_input">\
|
||||
<input class="bt-input-text mr5" type="text" style="width:150px" name="address" placeholder="IP地址">\
|
||||
<input class="bt-input-text mr5" name="netmask" type="text" style="width:150px" placeholder="子网掩码">\
|
||||
<input name="gateway" class="bt-input-text mr5" type="text" style="width:150px" placeholder="网关">\
|
||||
<button class="btn btn-success btn-sm va0" onclick="dockerAddIpPool()">添加</button>\
|
||||
</div>\
|
||||
<div class="divtable mtb10">\
|
||||
<div class="tablescroll">\
|
||||
<table id="ip_list" class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0" style="border: 0 none;">\
|
||||
<thead><tr>\
|
||||
<th>IP地址</th>\
|
||||
<th>子网掩码</th>\
|
||||
<th>网关</th>\
|
||||
<th style="text-align:right;">操作</th></tr></thead>\
|
||||
<tbody></tbody></table>\
|
||||
</div>\
|
||||
<div id="databasePage" class="dataTables_paginate paging_bootstrap page"></div>\
|
||||
</div>\
|
||||
</div>';
|
||||
|
||||
$(".soft-man-con").html(con);
|
||||
|
||||
dockerIpListRender();
|
||||
}
|
||||
|
||||
// login
|
||||
function repoLogin(){
|
||||
var _option1= "";
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ fi
|
|||
|
||||
cd ${curPath} && sh -x $curPath/versions/$2/install.sh $1
|
||||
|
||||
|
||||
if [ "${action}" == "install" ] && [ -d ${serverPath}/php/${type} ];then
|
||||
|
||||
#初始化
|
||||
|
|
|
|||
|
|
@ -15,11 +15,20 @@ SOURCE_ROOT=$rootPath/source/lib
|
|||
|
||||
if [ ! -d ${SERVER_ROOT}/freetype ];then
|
||||
cd $SOURCE_ROOT
|
||||
wget -O freetype-2.12.1.tar.gz --no-check-certificate https://download.savannah.gnu.org/releases/freetype/freetype-2.12.1.tar.gz -T 5
|
||||
tar zxvf freetype-2.12.1.tar.gz
|
||||
cd freetype-2.12.1
|
||||
|
||||
if [ ! -f $SOURCE_ROOT/freetype-2.12.1.tar.gz ];then
|
||||
wget -O freetype-2.12.1.tar.gz --no-check-certificate https://download.savannah.gnu.org/releases/freetype/freetype-2.12.1.tar.gz -T 5
|
||||
fi
|
||||
|
||||
if [ ! -d $SOURCE_ROOT/freetype-2.12.1 ];then
|
||||
tar zxvf freetype-2.12.1.tar.gz
|
||||
cd freetype-2.12.1
|
||||
else
|
||||
cd freetype-2.12.1
|
||||
fi
|
||||
|
||||
./configure --prefix=${SERVER_ROOT}/freetype && make && make install
|
||||
cd $SOURCE_ROOT
|
||||
cd $SOURCE_ROOT && rm -rf freetype-2.12.1
|
||||
#rm -rf freetype-2.12.1.tar.gz
|
||||
#rm -rf freetype-2.12.1
|
||||
|
||||
fi
|
||||
|
|
@ -15,11 +15,20 @@ SOURCE_ROOT=$rootPath/source/lib
|
|||
|
||||
if [ ! -d ${SERVER_ROOT}/freetype_old ];then
|
||||
cd $SOURCE_ROOT
|
||||
wget -O freetype-2.7.1.tar.gz --no-check-certificate https://download.savannah.gnu.org/releases/freetype/freetype-2.7.1.tar.gz -T 5
|
||||
tar zxvf freetype-2.7.1.tar.gz
|
||||
cd freetype-2.7.1
|
||||
|
||||
if [ ! -f $SOURCE_ROOT/freetype-2.7.1.tar.gz ];then
|
||||
wget -O freetype-2.7.1.tar.gz --no-check-certificate https://download.savannah.gnu.org/releases/freetype/freetype-2.7.1.tar.gz -T 5
|
||||
fi
|
||||
|
||||
if [ ! -d $SOURCE_ROOT/freetype-2.7.1 ];then
|
||||
tar zxvf freetype-2.7.1.tar.gz
|
||||
cd freetype-2.7.1
|
||||
else
|
||||
cd freetype-2.7.1
|
||||
fi
|
||||
|
||||
./configure --prefix=${SERVER_ROOT}/freetype_old && make && make install
|
||||
#cd $SOURCE_ROOT
|
||||
cd $SOURCE_ROOT && rm -rf freetype-2.7.1
|
||||
|
||||
#rm -rf freetype-2.7.1.tar.gz
|
||||
#rm -rf freetype-2.7.1
|
||||
fi
|
||||
|
|
@ -24,6 +24,22 @@ mkdir -p $serverPath/php
|
|||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
# ----------------------------------------------------------------------- #
|
||||
# 中国优化安装
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
LOCAL_ADDR=common
|
||||
if [ ! -z "$cn" ];then
|
||||
LOCAL_ADDR=cn
|
||||
fi
|
||||
|
||||
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||
fi
|
||||
fi
|
||||
# ----------------------------------------------------------------------- #
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.gz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.gz https://museum.php.net/php5/php-${version}.tar.gz
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -24,6 +24,22 @@ mkdir -p $serverPath/php
|
|||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
# ----------------------------------------------------------------------- #
|
||||
# 中国优化安装
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
LOCAL_ADDR=common
|
||||
if [ ! -z "$cn" ];then
|
||||
LOCAL_ADDR=cn
|
||||
fi
|
||||
|
||||
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||
fi
|
||||
fi
|
||||
# ----------------------------------------------------------------------- #
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php5/php-${version}.tar.xz
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -24,6 +24,22 @@ mkdir -p $serverPath/php
|
|||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
# ----------------------------------------------------------------------- #
|
||||
# 中国优化安装
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
LOCAL_ADDR=common
|
||||
if [ ! -z "$cn" ];then
|
||||
LOCAL_ADDR=cn
|
||||
fi
|
||||
|
||||
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||
fi
|
||||
fi
|
||||
# ----------------------------------------------------------------------- #
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.gz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.gz https://museum.php.net/php5/php-${version}.tar.gz
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -23,6 +23,22 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
|
|||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
# ----------------------------------------------------------------------- #
|
||||
# 中国优化安装
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
LOCAL_ADDR=common
|
||||
if [ ! -z "$cn" ];then
|
||||
LOCAL_ADDR=cn
|
||||
fi
|
||||
|
||||
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||
fi
|
||||
fi
|
||||
# ----------------------------------------------------------------------- #
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php5/php-${version}.tar.xz
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -23,6 +23,22 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
|
|||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
# ----------------------------------------------------------------------- #
|
||||
# 中国优化安装
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
LOCAL_ADDR=common
|
||||
if [ ! -z "$cn" ];then
|
||||
LOCAL_ADDR=cn
|
||||
fi
|
||||
|
||||
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||
fi
|
||||
fi
|
||||
# ----------------------------------------------------------------------- #
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php5/php-${version}.tar.xz
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -23,6 +23,22 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
|
|||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
# ----------------------------------------------------------------------- #
|
||||
# 中国优化安装
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
LOCAL_ADDR=common
|
||||
if [ ! -z "$cn" ];then
|
||||
LOCAL_ADDR=cn
|
||||
fi
|
||||
|
||||
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||
fi
|
||||
fi
|
||||
# ----------------------------------------------------------------------- #
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php7/php-${version}.tar.xz
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -23,6 +23,22 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
|
|||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
# ----------------------------------------------------------------------- #
|
||||
# 中国优化安装
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
LOCAL_ADDR=common
|
||||
if [ ! -z "$cn" ];then
|
||||
LOCAL_ADDR=cn
|
||||
fi
|
||||
|
||||
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||
fi
|
||||
fi
|
||||
# ----------------------------------------------------------------------- #
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php7/php-${version}.tar.xz
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -24,6 +24,22 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
|
|||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
# ----------------------------------------------------------------------- #
|
||||
# 中国优化安装
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
LOCAL_ADDR=common
|
||||
if [ ! -z "$cn" ];then
|
||||
LOCAL_ADDR=cn
|
||||
fi
|
||||
|
||||
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||
fi
|
||||
fi
|
||||
# ----------------------------------------------------------------------- #
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php7/php-${version}.tar.xz
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -28,6 +28,21 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
|
|||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
# ----------------------------------------------------------------------- #
|
||||
# 中国优化安装
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
LOCAL_ADDR=common
|
||||
if [ ! -z "$cn" ];then
|
||||
LOCAL_ADDR=cn
|
||||
fi
|
||||
|
||||
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||
fi
|
||||
fi
|
||||
# ----------------------------------------------------------------------- #
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php7/php-${version}.tar.xz
|
||||
|
|
|
|||
|
|
@ -36,6 +36,21 @@ fi
|
|||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
# ----------------------------------------------------------------------- #
|
||||
# 中国优化安装
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
LOCAL_ADDR=common
|
||||
if [ ! -z "$cn" ];then
|
||||
LOCAL_ADDR=cn
|
||||
fi
|
||||
|
||||
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||
fi
|
||||
fi
|
||||
# ----------------------------------------------------------------------- #
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php7/php-${version}.tar.xz
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -35,6 +35,22 @@ if [ "$?" == "0" ];then
|
|||
fi
|
||||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
# ----------------------------------------------------------------------- #
|
||||
# 中国优化安装
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
LOCAL_ADDR=common
|
||||
if [ ! -z "$cn" ];then
|
||||
LOCAL_ADDR=cn
|
||||
fi
|
||||
|
||||
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||
fi
|
||||
fi
|
||||
# ----------------------------------------------------------------------- #
|
||||
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://www.php.net/distributions/php-${version}.tar.xz
|
||||
|
|
|
|||
|
|
@ -36,6 +36,22 @@ fi
|
|||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
# ----------------------------------------------------------------------- #
|
||||
# 中国优化安装
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
LOCAL_ADDR=common
|
||||
if [ ! -z "$cn" ];then
|
||||
LOCAL_ADDR=cn
|
||||
fi
|
||||
|
||||
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||
fi
|
||||
fi
|
||||
# ----------------------------------------------------------------------- #
|
||||
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://www.php.net/distributions/php-${version}.tar.xz
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -36,6 +36,22 @@ fi
|
|||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
# ----------------------------------------------------------------------- #
|
||||
# 中国优化安装
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
LOCAL_ADDR=common
|
||||
if [ ! -z "$cn" ];then
|
||||
LOCAL_ADDR=cn
|
||||
fi
|
||||
|
||||
if [ "$LOCAL_ADDR" == "cn" ];then
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
|
||||
fi
|
||||
fi
|
||||
# ----------------------------------------------------------------------- #
|
||||
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://www.php.net/distributions/php-${version}.tar.xz
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ if [ ! -f /usr/sbin/firewalld ];then
|
|||
|
||||
# look
|
||||
# firewall-cmd --list-all
|
||||
# systemctl status firewalld
|
||||
|
||||
if [ "$SSH_PORT" != "" ];then
|
||||
firewall-cmd --permanent --zone=public --add-port=${SSH_PORT}/tcp
|
||||
|
|
|
|||
Loading…
Reference in New Issue