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 @@ @@ -2,8 +2,9 @@
echo "Upgrade machete ..."
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_filesite="https://git.filesite.io/filesite/machete/archive/master.tar.gz"
# 检测域名是否能连接
@ -39,17 +40,18 @@ if [ -d machete/ ]; then @@ -39,17 +40,18 @@ if [ -d machete/ ]; then
rm -rf machete/
fi
# 升级machete
detect_domain="git.filesite.io"
detect_domain="gitcode.net"
echo "检测${detect_domain}是否可连接..."
detectDomainCanConnect "${detect_domain}"
connect_res=$?
if [ $connect_res -eq 0 ]; then
echo "⚠"
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"
else
curl --connect-timeout 15 "${download_link_gitcode}" -o "master.tar.gz"
fi
if [ -f "master.tar.gz" ]; then
@ -70,20 +72,21 @@ echo "Machete front-end upgraded." @@ -70,20 +72,21 @@ echo "Machete front-end upgraded."
echo ""
# admin/后台不再维护
# upgrade admin
cd /var/www/downloads/
curl --connect-timeout 15 "https://git.filesite.io/wen/jialuomaadmin/archive/master.tar.gz" -o "master.tar.gz"
if [ -f "master.tar.gz" ]; then
tar -zxvf master.tar.gz
rm -f master.tar.gz
rm -rf /var/www/machete/www/admin/
mv jialuomaadmin/dist/ /var/www/machete/www/admin
fi
echo "Admin system upgraded."
echo ""
## cd /var/www/downloads/
## curl --connect-timeout 15 "https://git.filesite.io/wen/jialuomaadmin/archive/master.tar.gz" -o "master.tar.gz"
## if [ -f "master.tar.gz" ]; then
##
## tar -zxvf master.tar.gz
## rm -f master.tar.gz
## rm -rf /var/www/machete/www/admin/
## mv jialuomaadmin/dist/ /var/www/machete/www/admin
##
## fi
## echo "Admin system upgraded."
## echo ""
# upgrade nginx config

Loading…
Cancel
Save