From 99aeda79390a9518c4aabd4c120860a3d6966ef5 Mon Sep 17 00:00:00 2001
From: UUBulb <35923940+uubulb@users.noreply.github.com>
Date: Tue, 22 Oct 2024 10:25:31 +0800
Subject: [PATCH 1/2] installer: fix format (#448)
---
script/install.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/script/install.sh b/script/install.sh
index ac34d74..c5d147a 100755
--- a/script/install.sh
+++ b/script/install.sh
@@ -823,7 +823,7 @@ show_usage() {
}
show_menu() {
- echo "
+ printf "
${green}哪吒监控管理脚本${plain} ${red}${NZ_VERSION}${plain}
--- https://github.com/naiba/nezha ---
${green}1.${plain} 安装面板端
@@ -844,7 +844,7 @@ show_menu() {
————————————————-
${green}0.${plain} 退出脚本
"
- printf "请输入选择 [0-13]: " && read -r num
+ echo && printf "请输入选择 [0-13]: " && read -r num
case "${num}" in
0)
exit 0
From 67b003a27d55cf7d7d264f5b791f875d11ca1ba3 Mon Sep 17 00:00:00 2001
From: UUBulb <35923940+uubulb@users.noreply.github.com>
Date: Tue, 22 Oct 2024 13:02:54 +0800
Subject: [PATCH 2/2] installer: fix download service scripts (#449)
---
README.md | 2 +-
script/install.sh | 6 +++++-
script/install_en.sh | 6 +++++-
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 6c76929..98b970c 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
LOGO designed by 熊大 .
-
+
:trollface: Nezha Monitoring: Self-hostable, lightweight, servers and websites monitoring and O&M tool.
diff --git a/script/install.sh b/script/install.sh index c5d147a..410569a 100755 --- a/script/install.sh +++ b/script/install.sh @@ -12,7 +12,7 @@ NZ_DASHBOARD_PATH="${NZ_BASE_PATH}/dashboard" NZ_AGENT_PATH="${NZ_BASE_PATH}/agent" NZ_DASHBOARD_SERVICE="/etc/systemd/system/nezha-dashboard.service" NZ_DASHBOARD_SERVICERC="/etc/init.d/nezha-dashboard" -NZ_VERSION="v0.20.1" +NZ_VERSION="v0.20.2" red='\033[0;31m' green='\033[0;32m' @@ -538,6 +538,10 @@ modify_dashboard_config() { echo "正在下载服务文件" if [ "$os_alpine" != 1 ]; then _download="sudo wget -t 2 -T 60 -O $NZ_DASHBOARD_SERVICE https://${GITHUB_RAW_URL}/script/nezha-dashboard.service >/dev/null 2>&1" + if ! eval "$_download"; then + err "文件下载失败,请检查本机能否连接 ${GITHUB_RAW_URL}" + return 0 + fi else _download="sudo wget -t 2 -T 60 -O $NZ_DASHBOARD_SERVICERC https://${GITHUB_RAW_URL}/script/nezha-dashboard >/dev/null 2>&1" if ! eval "$_download"; then diff --git a/script/install_en.sh b/script/install_en.sh index e6611f9..54d24c4 100755 --- a/script/install_en.sh +++ b/script/install_en.sh @@ -12,7 +12,7 @@ NZ_DASHBOARD_PATH="${NZ_BASE_PATH}/dashboard" NZ_AGENT_PATH="${NZ_BASE_PATH}/agent" NZ_DASHBOARD_SERVICE="/etc/systemd/system/nezha-dashboard.service" NZ_DASHBOARD_SERVICERC="/etc/init.d/nezha-dashboard" -NZ_VERSION="v0.20.1" +NZ_VERSION="v0.20.2" red='\033[0;31m' green='\033[0;32m' @@ -537,6 +537,10 @@ modify_dashboard_config() { echo "Downloading service file" if [ "$os_alpine" != 1 ]; then _download="sudo wget -t 2 -T 60 -O $NZ_DASHBOARD_SERVICE https://${GITHUB_RAW_URL}/script/nezha-dashboard.service >/dev/null 2>&1" + if ! eval "$_download"; then + err "File failed to get, please check if the network can link ${GITHUB_RAW_URL}" + return 0 + fi else _download="sudo wget -t 2 -T 60 -O $NZ_DASHBOARD_SERVICERC https://${GITHUB_RAW_URL}/script/nezha-dashboard >/dev/null 2>&1" if ! eval "$_download"; then