🔨 install script v4.0.1

This commit is contained in:
naiba
2021-01-31 18:47:43 +08:00
parent 7994c1d1a2
commit f56332b235
3 changed files with 6 additions and 6 deletions

View File

@@ -10,7 +10,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="v4.0.0"
NZ_VERSION="v4.0.1"
GITHUB_RAW_URL="raw.githubusercontent.com"
GITHUB_URL="github.com"
@@ -201,10 +201,10 @@ modify_agent_config() {
fi
echo "请先在管理面板上添加Agent记录下密钥" &&
read -p "请输入一个解析到面板所在IP的域名不可套CDN: " nz_rpc_host &&
read -p "请输入一个解析到面板所在IP的域名不可套CDN: " nz_grpc_host &&
read -p "请输入面板RPC端口: (5555)" nz_grpc_port &&
read -p "请输入Agent 密钥: " nezha_client_secret
if [[ -z "${nz_rpc_host}" || -z "${nezha_client_secret}" ]]; then
if [[ -z "${nz_grpc_host}" || -z "${nezha_client_secret}" ]]; then
echo -e "${red}所有选项都不能为空${plain}"
before_show_menu
return 1
@@ -214,7 +214,7 @@ modify_agent_config() {
nz_grpc_port=5555
fi
sed -i "s/nz_rpc_host/${nz_rpc_host}/" ${NZ_AGENT_SERVICE}
sed -i "s/nz_grpc_host/${nz_grpc_host}/" ${NZ_AGENT_SERVICE}
sed -i "s/nz_grpc_port/${nz_grpc_port}/" ${NZ_AGENT_SERVICE}
sed -i "s/nezha_client_secret/${nezha_client_secret}/" ${NZ_AGENT_SERVICE}

View File

@@ -15,7 +15,7 @@ Type=simple
User=root
Group=root
WorkingDirectory=/opt/nezha/agent/
ExecStart=/opt/nezha/agent/nezha-agent -d -s nz_rpc_host:nz_grpc_port -p nezha_client_secret
ExecStart=/opt/nezha/agent/nezha-agent -d -s nz_grpc_host:nz_grpc_port -p nezha_client_secret
Restart=always
#Environment=DEBUG=true