From ea7b5055f31b3864bea3712fced0f55059402e29 Mon Sep 17 00:00:00 2001 From: filesite Date: Sat, 10 Aug 2024 08:55:42 +0800 Subject: [PATCH] change upgrade tar.gz default download url to gitcode --- bin/upgrade.sh | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/bin/upgrade.sh b/bin/upgrade.sh index f48457a..2608978 100755 --- a/bin/upgrade.sh +++ b/bin/upgrade.sh @@ -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 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." 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