diff --git a/README.md b/README.md
index 3670f2b..fe2b4f1 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.
@@ -40,9 +40,9 @@ You can change the system language in the settings page (`/setting`) after the a ## Special Thanks - [@JackieSung](https://github.com/JackieSung4ev) for our first community-contributed front-end theme. -- [@Erope](https://github.com/JackieSung4ev) for contributed a lot to our installation scripts and community building. +- [@Erope](https://github.com/Erope) for contributed a lot to our installation scripts and community building. - [@MikoyChinese](https://github.com/MikoyChinese) for our second community-contributed front-end theme. -- [@AkkiaS7](https://github.com/Akkia) and [@hhhkkk520](https://github.com/hhhkkk520) for the excellent contribution in the early days of globalization. +- [@AkkiaS7](https://github.com/AkkiaS7) and [@hhhkkk520](https://github.com/hhhkkk520) for the excellent contribution in the early days of globalization. - [@dysf888](https://github.com/dysf888) for the installation script in Windows. - [@MartijnLindeman](https://github.com/MartijnLindeman) for his perseverance has taken us to the international market. - and other [contributors](https://github.com/naiba/nezha/graphs/contributors). diff --git a/docs/UserGuide_en.md b/docs/UserGuide_en.md index 0ecaf27..3262f36 100644 --- a/docs/UserGuide_en.md +++ b/docs/UserGuide_en.md @@ -5,8 +5,7 @@ **Recommended configuration:** Prepare _two domains_ before installation,a domain can **connect to CDN** for _Public Access_,for example (status.nai.ba). Another domain name resolves to the panel server allows the Agent can connect to the Dashboard,This domain **cannot connect to CDN** You need to make it expose the ip of the panel server directly. ```shell -curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install_en.sh -o nezha.sh && chmod +x nezha.sh -sudo ./nezha.sh +curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install_en.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh ``` _\* Use WatchTower to automatically update the panel, and in Windows you can use nssm to configure self-start_ diff --git a/docs/UserGuide_zh.md b/docs/UserGuide_zh.md index 7f60847..fde0801 100644 --- a/docs/UserGuide_zh.md +++ b/docs/UserGuide_zh.md @@ -13,15 +13,13 @@ **推荐配置:** 安装前准备 _两个域名_,一个可以 **接入 CDN** 作为 _公开访问_,比如 (status.nai.ba);另外一个解析到面板服务器作为 Agent 连接 Dashboard 使用,**不能接入 CDN** 直接暴露面板主机 IP,比如(ip-to-dashboard.nai.ba)。 ```shell -curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh -sudo ./nezha.sh +curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh ``` 国内镜像加速: ```shell -curl -L https://fastly.jsdelivr.net/gh/naiba/nezha@master/script/install.sh -o nezha.sh && chmod +x nezha.sh -CN=true sudo ./nezha.sh +curl -L https://fastly.jsdelivr.net/gh/naiba/nezha@master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo CN=true ./nezha.sh ``` _\* 使用 WatchTower 可以自动更新面板,Windows 终端可以使用 nssm 配置自启动_ diff --git a/script/install.sh b/script/install.sh index 46d6436..ecf25c0 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.10.0" red='\033[0;31m' green='\033[0;32m' @@ -141,7 +141,26 @@ install_dashboard() { echo -e "> 安装面板" # 哪吒监控文件夹 - mkdir -p $NZ_DASHBOARD_PATH + if [ ! -d "${NZ_DASHBOARD_PATH}" ]; then + mkdir -p $NZ_DASHBOARD_PATH + else + echo "您可能已经安装过面板端,重复安装会覆盖数据,请注意备份。" + read -e -r -p "是否退出安装? [Y/n] " input + case $input in + [yY][eE][sS] | [yY]) + echo "退出安装" + exit 0 + ;; + [nN][oO] | [nN]) + echo "继续安装" + ;; + *) + echo "退出安装" + exit 0 + ;; + esac + fi + chmod 777 -R $NZ_DASHBOARD_PATH command -v docker >/dev/null 2>&1 @@ -187,6 +206,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 "获取版本号失败,请检查本机能否链接 https://api.github.com/repos/naiba/nezha/releases/latest" diff --git a/script/install_en.sh b/script/install_en.sh index b08db04..240fd64 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.10.0" 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"