Add reinstall dashboard warning && Update README

This commit is contained in:
Erope 2022-05-07 22:49:25 +08:00
parent c9e0b29515
commit 82a395dccf
No known key found for this signature in database
GPG Key ID: 934F29AB0411C0E9
3 changed files with 26 additions and 7 deletions

View File

@ -5,8 +5,7 @@
**Recommended configuration** Prepare _two domains_ before installationa 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 DashboardThis domain **cannot connect to CDN** You need to make it expose the ip of the panel server directly. **Recommended configuration** Prepare _two domains_ before installationa 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 DashboardThis domain **cannot connect to CDN** You need to make it expose the ip of the panel server directly.
```shell ```shell
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install_en.sh -o nezha.sh && chmod +x 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
sudo ./nezha.sh
``` ```
_\* Use WatchTower to automatically update the panel, and in Windows you can use nssm to configure self-start_ _\* Use WatchTower to automatically update the panel, and in Windows you can use nssm to configure self-start_

View File

@ -13,15 +13,13 @@
**推荐配置:** 安装前准备 _两个域名_,一个可以 **接入 CDN** 作为 _公开访问_,比如 (status.nai.ba);另外一个解析到面板服务器作为 Agent 连接 Dashboard 使用,**不能接入 CDN** 直接暴露面板主机 IP比如ip-to-dashboard.nai.ba **推荐配置:** 安装前准备 _两个域名_,一个可以 **接入 CDN** 作为 _公开访问_,比如 (status.nai.ba);另外一个解析到面板服务器作为 Agent 连接 Dashboard 使用,**不能接入 CDN** 直接暴露面板主机 IP比如ip-to-dashboard.nai.ba
```shell ```shell
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh
sudo ./nezha.sh
``` ```
国内镜像加速: 国内镜像加速:
```shell ```shell
curl -L https://fastly.jsdelivr.net/gh/naiba/nezha@master/script/install.sh -o nezha.sh && chmod +x 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
CN=true sudo ./nezha.sh
``` ```
_\* 使用 WatchTower 可以自动更新面板Windows 终端可以使用 nssm 配置自启动_ _\* 使用 WatchTower 可以自动更新面板Windows 终端可以使用 nssm 配置自启动_

View File

@ -141,7 +141,26 @@ install_dashboard() {
echo -e "> 安装面板" 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 chmod 777 -R $NZ_DASHBOARD_PATH
command -v docker >/dev/null 2>&1 command -v docker >/dev/null 2>&1
@ -187,6 +206,9 @@ install_agent() {
if [ ! -n "$version" ]; then 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') 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 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 if [ ! -n "$version" ]; then
echo -e "获取版本号失败,请检查本机能否链接 https://api.github.com/repos/naiba/nezha/releases/latest" echo -e "获取版本号失败,请检查本机能否链接 https://api.github.com/repos/naiba/nezha/releases/latest"