From ccc33d628a68dc34c83eba18d44fb2d6d491f9d2 Mon Sep 17 00:00:00 2001 From: Erope Date: Tue, 6 Jul 2021 21:50:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=80=9F=E7=94=A8jsdelivr=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/install.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/script/install.sh b/script/install.sh index b7cfb78..c83d812 100755 --- a/script/install.sh +++ b/script/install.sh @@ -134,7 +134,7 @@ install_dashboard() { echo -e "> 安装面板" - if [[ $(uname -m | grep 'arm') != "" ]]; then + if [[ $(uname -m | grep 'arm\|aarch') != "" ]]; then echo "面板目前不支持在 arm 环境下安装" exit 1 fi @@ -182,10 +182,14 @@ install_agent() { echo -e "正在获取监控Agent版本号" - local version=$(curl -sL "https://api.github.com/repos/naiba/nezha/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g') + local version=$(curl -m 10 -sL "https://api.github.com/repos/naiba/nezha/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g') + if [ ! -n "$version" ]; then + version=$(curl -m 10 -sL "https://cdn.jsdelivr.net/gh/naiba/nezha/" | grep "option\.value" | awk -F "'" '{print $2}' | sed 's/naiba\/nezha@/v/g') + fi if [ ! -n "$version" ]; then echo -e "获取版本号失败,请检查本机能否链接 https://api.github.com/repos/naiba/nezha/releases/latest" + return 0 else echo -e "当前最新版本为: ${version}" fi