Browse Source

change upgrade tar.gz default download url to gitcode

master
filesite 4 months ago
parent
commit
ea7b5055f3
  1. 37
      bin/upgrade.sh

37
bin/upgrade.sh

@ -2,8 +2,9 @@
echo "Upgrade machete ..." echo "Upgrade machete ..."
echo "" echo ""
download_link_filesite="https://git.filesite.io/filesite/machete/archive/master.tar.gz" ## 改为优先从gitcode下载,避免域名解析问题
download_link_gitcode="https://gitcode.net/filesite/machete/-/archive/master/machete-master.tar.gz" download_link_gitcode="https://gitcode.net/filesite/machete/-/archive/master/machete-master.tar.gz"
download_link_filesite="https://git.filesite.io/filesite/machete/archive/master.tar.gz"
# 检测域名是否能连接 # 检测域名是否能连接
@ -39,17 +40,18 @@ if [ -d machete/ ]; then
rm -rf machete/ rm -rf machete/
fi fi
# 升级machete # 升级machete
detect_domain="git.filesite.io" detect_domain="gitcode.net"
echo "检测${detect_domain}是否可连接..." echo "检测${detect_domain}是否可连接..."
detectDomainCanConnect "${detect_domain}" detectDomainCanConnect "${detect_domain}"
connect_res=$? connect_res=$?
if [ $connect_res -eq 0 ]; then if [ $connect_res -eq 0 ]; then
echo "⚠" echo "⚠"
echo "当前网络无法连接[${detect_domain}],即将从备用网址下载machete" echo "当前网络无法连接[${detect_domain}],即将从备用网址下载machete"
curl --connect-timeout 15 "${download_link_gitcode}" -o "master.tar.gz"
else
curl --connect-timeout 15 "${download_link_filesite}" -o "master.tar.gz" curl --connect-timeout 15 "${download_link_filesite}" -o "master.tar.gz"
else
curl --connect-timeout 15 "${download_link_gitcode}" -o "master.tar.gz"
fi fi
if [ -f "master.tar.gz" ]; then if [ -f "master.tar.gz" ]; then
@ -70,20 +72,21 @@ echo "Machete front-end upgraded."
echo "" echo ""
# admin/后台不再维护
# upgrade admin # upgrade admin
cd /var/www/downloads/ ## cd /var/www/downloads/
curl --connect-timeout 15 "https://git.filesite.io/wen/jialuomaadmin/archive/master.tar.gz" -o "master.tar.gz" ## curl --connect-timeout 15 "https://git.filesite.io/wen/jialuomaadmin/archive/master.tar.gz" -o "master.tar.gz"
if [ -f "master.tar.gz" ]; then ## if [ -f "master.tar.gz" ]; then
##
tar -zxvf master.tar.gz ## tar -zxvf master.tar.gz
rm -f master.tar.gz ## rm -f master.tar.gz
rm -rf /var/www/machete/www/admin/ ## rm -rf /var/www/machete/www/admin/
mv jialuomaadmin/dist/ /var/www/machete/www/admin ## mv jialuomaadmin/dist/ /var/www/machete/www/admin
##
fi ## fi
echo "Admin system upgraded." ## echo "Admin system upgraded."
echo "" ## echo ""
# upgrade nginx config # upgrade nginx config

Loading…
Cancel
Save