From 7fcd4398eae86d27a60bba903bf32d65fcb1badd Mon Sep 17 00:00:00 2001 From: "Nanjing Hopefun Network Technology Co. Ltd" <447451077@qq.com> Date: Sat, 13 Apr 2024 11:14:46 +0800 Subject: [PATCH] Update install.sh (#347) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改自动安装超时时间-T 10为-T 60,10秒超时在wget那一步经常连接探针下载失败。 --- script/install.sh | 16 ++++++++-------- script/install_en.sh | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/script/install.sh b/script/install.sh index 1adbffb..5629a47 100755 --- a/script/install.sh +++ b/script/install.sh @@ -14,7 +14,7 @@ NZ_AGENT_SERVICE="/etc/systemd/system/nezha-agent.service" NZ_AGENT_SERVICERC="/etc/init.d/nezha-agent" NZ_DASHBOARD_SERVICE="/etc/systemd/system/nezha-dashboard.service" NZ_DASHBOARD_SERVICERC="/etc/init.d/nezha-dashboard" -NZ_VERSION="v0.16.0" +NZ_VERSION="v0.16.1" red='\033[0;31m' green='\033[0;32m' @@ -335,7 +335,7 @@ install_agent() { chmod 777 -R $NZ_AGENT_PATH echo -e "正在下载监控端" - wget -t 2 -T 10 -O nezha-agent_linux_${os_arch}.zip https://${GITHUB_URL}/nezhahq/agent/releases/download/${version}/nezha-agent_linux_${os_arch}.zip >/dev/null 2>&1 + wget -t 2 -T 60 -O nezha-agent_linux_${os_arch}.zip https://${GITHUB_URL}/nezhahq/agent/releases/download/${version}/nezha-agent_linux_${os_arch}.zip >/dev/null 2>&1 if [[ $? != 0 ]]; then echo -e "${red}Release 下载失败,请检查本机能否连接 ${GITHUB_URL}${plain}" return 0 @@ -360,13 +360,13 @@ modify_agent_config() { echo -e "> 修改Agent配置" if [ "$os_alpine" != 1 ]; then - wget -t 2 -T 10 -O $NZ_AGENT_SERVICE https://${GITHUB_RAW_URL}/script/nezha-agent.service >/dev/null 2>&1 + wget -t 2 -T 60 -O $NZ_AGENT_SERVICE https://${GITHUB_RAW_URL}/script/nezha-agent.service >/dev/null 2>&1 if [[ $? != 0 ]]; then echo -e "${red}文件下载失败,请检查本机能否连接 ${GITHUB_RAW_URL}${plain}" return 0 fi else - wget -t 2 -T 10 -O $NZ_AGENT_SERVICERC https://${GITHUB_RAW_URL}/script/nezha-agent >/dev/null 2>&1 + wget -t 2 -T 60 -O $NZ_AGENT_SERVICERC https://${GITHUB_RAW_URL}/script/nezha-agent >/dev/null 2>&1 chmod +x $NZ_AGENT_SERVICERC if [[ $? != 0 ]]; then echo -e "${red}Fail to download service, please check if the network can link ${GITHUB_RAW_URL}${plain}" @@ -432,14 +432,14 @@ modify_dashboard_config() { if [[ $IS_DOCKER_NEZHA == 1 ]]; then echo -e "正在下载 Docker 脚本" - wget -t 2 -T 10 -O /tmp/nezha-docker-compose.yaml https://${GITHUB_RAW_URL}/script/docker-compose.yaml >/dev/null 2>&1 + wget -t 2 -T 60 -O /tmp/nezha-docker-compose.yaml https://${GITHUB_RAW_URL}/script/docker-compose.yaml >/dev/null 2>&1 if [[ $? != 0 ]]; then echo -e "${red}下载脚本失败,请检查本机能否连接 ${GITHUB_RAW_URL}${plain}" return 0 fi fi - wget -t 2 -T 10 -O /tmp/nezha-config.yaml https://${GITHUB_RAW_URL}/script/config.yaml >/dev/null 2>&1 + wget -t 2 -T 60 -O /tmp/nezha-config.yaml https://${GITHUB_RAW_URL}/script/config.yaml >/dev/null 2>&1 if [[ $? != 0 ]]; then echo -e "${red}下载脚本失败,请检查本机能否连接 ${GITHUB_RAW_URL}${plain}" return 0 @@ -495,9 +495,9 @@ modify_dashboard_config() { if [[ $IS_DOCKER_NEZHA == 0 ]]; then echo -e "正在下载服务文件" if [ "$os_alpine" != 1 ]; then - wget -t 2 -T 10 -O $NZ_DASHBOARD_SERVICE https://${GITHUB_RAW_URL}/script/nezha-dashboard.service >/dev/null 2>&1 + wget -t 2 -T 60 -O $NZ_DASHBOARD_SERVICE https://${GITHUB_RAW_URL}/script/nezha-dashboard.service >/dev/null 2>&1 else - wget -t 2 -T 10 -O $NZ_DASHBOARD_SERVICERC https://${GITHUB_RAW_URL}/script/nezha-dashboard >/dev/null 2>&1 + wget -t 2 -T 60 -O $NZ_DASHBOARD_SERVICERC https://${GITHUB_RAW_URL}/script/nezha-dashboard >/dev/null 2>&1 chmod +x $NZ_DASHBOARD_SERVICERC if [[ $? != 0 ]]; then echo -e "${red}文件下载失败,请检查本机能否连接 ${GITHUB_RAW_URL}${plain}" diff --git a/script/install_en.sh b/script/install_en.sh index 24c5040..dcf1cf7 100755 --- a/script/install_en.sh +++ b/script/install_en.sh @@ -14,7 +14,7 @@ NZ_AGENT_SERVICE="/etc/systemd/system/nezha-agent.service" NZ_AGENT_SERVICERC="/etc/init.d/nezha-agent" NZ_DASHBOARD_SERVICE="/etc/systemd/system/nezha-dashboard.service" NZ_DASHBOARD_SERVICERC="/etc/init.d/nezha-dashboard" -NZ_VERSION="v0.16.0" +NZ_VERSION="v0.16.1" red='\033[0;31m' green='\033[0;32m' @@ -331,7 +331,7 @@ install_agent() { chmod 777 -R $NZ_AGENT_PATH echo -e "Downloading Agent" - wget -t 2 -T 10 -O nezha-agent_linux_${os_arch}.zip https://${GITHUB_URL}/nezhahq/agent/releases/download/${version}/nezha-agent_linux_${os_arch}.zip >/dev/null 2>&1 + wget -t 2 -T 60 -O nezha-agent_linux_${os_arch}.zip https://${GITHUB_URL}/nezhahq/agent/releases/download/${version}/nezha-agent_linux_${os_arch}.zip >/dev/null 2>&1 if [[ $? != 0 ]]; then echo -e "${red}Fail to download agent, please check if the network can link ${GITHUB_URL}${plain}" return 0 @@ -356,13 +356,13 @@ modify_agent_config() { echo -e "> Modify Agent Configuration" if [ "$os_alpine" != 1 ]; then - wget -t 2 -T 10 -O $NZ_AGENT_SERVICE https://${GITHUB_RAW_URL}/script/nezha-agent.service >/dev/null 2>&1 + wget -t 2 -T 60 -O $NZ_AGENT_SERVICE https://${GITHUB_RAW_URL}/script/nezha-agent.service >/dev/null 2>&1 if [[ $? != 0 ]]; then echo -e "${red}Fail to download service, please check if the network can link ${GITHUB_RAW_URL}${plain}" return 0 fi else - wget -t 2 -T 10 -O $NZ_AGENT_SERVICERC https://${GITHUB_RAW_URL}/script/nezha-agent >/dev/null 2>&1 + wget -t 2 -T 60 -O $NZ_AGENT_SERVICERC https://${GITHUB_RAW_URL}/script/nezha-agent >/dev/null 2>&1 chmod +x $NZ_AGENT_SERVICERC if [[ $? != 0 ]]; then echo -e "${red}Fail to download service, please check if the network can link ${GITHUB_RAW_URL}${plain}" @@ -428,14 +428,14 @@ modify_dashboard_config() { if [[ $IS_DOCKER_NEZHA == 1 ]]; then echo -e "Download Docker Script" - wget -t 2 -T 10 -O /tmp/nezha-docker-compose.yaml https://${GITHUB_RAW_URL}/script/docker-compose.yaml >/dev/null 2>&1 + wget -t 2 -T 60 -O /tmp/nezha-docker-compose.yaml https://${GITHUB_RAW_URL}/script/docker-compose.yaml >/dev/null 2>&1 if [[ $? != 0 ]]; then echo -e "${red}Script failed to get, please check if the network can link ${GITHUB_RAW_URL}${plain}" return 0 fi fi - wget -t 2 -T 10 -O /tmp/nezha-config.yaml https://${GITHUB_RAW_URL}/script/config.yaml >/dev/null 2>&1 + wget -t 2 -T 60 -O /tmp/nezha-config.yaml https://${GITHUB_RAW_URL}/script/config.yaml >/dev/null 2>&1 if [[ $? != 0 ]]; then echo -e "${red}Script failed to get, please check if the network can link ${GITHUB_RAW_URL}${plain}" return 0 @@ -491,9 +491,9 @@ modify_dashboard_config() { if [[ $IS_DOCKER_NEZHA == 0 ]]; then echo -e "Downloading service file" if [ "$os_alpine" != 1 ]; then - wget -t 2 -T 10 -O $NZ_DASHBOARD_SERVICE https://${GITHUB_RAW_URL}/script/nezha-dashboard.service >/dev/null 2>&1 + wget -t 2 -T 60 -O $NZ_DASHBOARD_SERVICE https://${GITHUB_RAW_URL}/script/nezha-dashboard.service >/dev/null 2>&1 else - wget -t 2 -T 10 -O $NZ_DASHBOARD_SERVICERC https://${GITHUB_RAW_URL}/script/nezha-dashboard >/dev/null 2>&1 + wget -t 2 -T 60 -O $NZ_DASHBOARD_SERVICERC https://${GITHUB_RAW_URL}/script/nezha-dashboard >/dev/null 2>&1 chmod +x $NZ_DASHBOARD_SERVICERC if [[ $? != 0 ]]; then echo -e "${red}File failed to get, please check if the network can link ${GITHUB_RAW_URL}${plain}"