From ccc33d628a68dc34c83eba18d44fb2d6d491f9d2 Mon Sep 17 00:00:00 2001 From: Erope Date: Tue, 6 Jul 2021 21:50:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=80=9F=E7=94=A8jsdelivr=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=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 From 1df899fae72d657cf19c2674e1ea7ca44550c37b Mon Sep 17 00:00:00 2001 From: Erope Date: Tue, 6 Jul 2021 22:51:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9install=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/install.sh b/script/install.sh index c83d812..27fa956 100755 --- a/script/install.sh +++ b/script/install.sh @@ -11,7 +11,7 @@ NZ_BASE_PATH="/opt/nezha" NZ_DASHBOARD_PATH="${NZ_BASE_PATH}/dashboard" NZ_AGENT_PATH="${NZ_BASE_PATH}/agent" NZ_AGENT_SERVICE="/etc/systemd/system/nezha-agent.service" -NZ_VERSION="v0.6.2" +NZ_VERSION="v0.6.3" red='\033[0;31m' green='\033[0;32m'