diff --git a/README.md b/README.md
index d4f6f2f..6bd7d34 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
LOGO designed by 熊大 .
-
+
:trollface: Nezha Monitoring self-hosted lightweight monitoring and operation and maintenance system. Supports system status, HTTP (SSL certificate change, upcoming expiration, expiration), TCP, Ping monitoring and alerting, execute scheduled tasks and web terminal.
diff --git a/script/install.sh b/script/install.sh index daa4b58..a3a43e1 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.9.1" +NZ_VERSION="v0.9.2" red='\033[0;31m' green='\033[0;32m' diff --git a/script/install_en.sh b/script/install_en.sh index b08db04..aa02722 100755 --- a/script/install_en.sh +++ b/script/install_en.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.9.1" +NZ_VERSION="v0.9.2" red='\033[0;31m' green='\033[0;32m' @@ -111,7 +111,25 @@ install_dashboard() { echo -e "> Install Panel" # Nezha Monitoring Folder - mkdir -p $NZ_DASHBOARD_PATH + if [ ! -d "${NZ_DASHBOARD_PATH}" ]; then + mkdir -p $NZ_DASHBOARD_PATH + else + echo "You may have already installed the dashboard, repeated installation will overwrite the data, please pay attention to backup." + read -e -r -p "Exit the installation? [Y/n] " input + case $input in + [yY][eE][sS] | [yY]) + echo "Exit the installation." + exit 0 + ;; + [nN][oO] | [nN]) + echo "Continue." + ;; + *) + echo "Exit the installation." + exit 0 + ;; + esac + fi chmod 777 -R $NZ_DASHBOARD_PATH command -v docker >/dev/null 2>&1 @@ -157,6 +175,9 @@ install_agent() { if [ ! -n "$version" ]; then version=$(curl -m 10 -sL "https://fastly.jsdelivr.net/gh/naiba/nezha/" | grep "option\.value" | awk -F "'" '{print $2}' | sed 's/naiba\/nezha@/v/g') fi + if [ ! -n "$version" ]; then + version=$(curl -m 10 -sL "https://gcore.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 "Fail to obtaine agent version, please check if the network can link https://api.github.com/repos/naiba/nezha/releases/latest"