diff --git a/Public/init-script-wdd.sh b/Public/init-script-wdd.sh index 1e60bab..27175d8 100644 --- a/Public/init-script-wdd.sh +++ b/Public/init-script-wdd.sh @@ -910,7 +910,7 @@ SyslogIdentifier=octopus-agent User=root Type=simple WorkingDirectory=$octopus_agent_path -ExecStart=$octopus_agent_path/octopus-agent -agentServerInfoConfFile=$octopus_agent_path/octopus-agent.conf -version=standard +ExecStart=$octopus_agent_path/octopus-agent -version=standard ExecStop=/bin/kill -15 \$MAINPID [Install] @@ -927,6 +927,8 @@ EOF rsyslogd -N1 -f /etc/rsyslog.d/octopus-agent.conf systemctl restart rsyslog + colorEchoGreen "Agent守护程序设置成功!" + FunctionEnd } @@ -1019,14 +1021,41 @@ install_octopus_agent() { ls ${octopus_agent_path} | grep ".yaml" echo "" - log "开始配置Agent启动的基础环境信息" - rm -rf "$octopus_agent_path/lib/wdd-lib-env.sh" - wget "${oss_url_prefix}/wdd-lib-env.sh" -qO "${octopus_agent_path}/lib/wdd-lib-env.sh" - SplitGreen - log "开始收集Agent主机的信息!" - echo "" - chmod +x "${octopus_agent_path}/lib/wdd-lib-env.sh" - bash "${octopus_agent_path}/lib/wdd-lib-env.sh" +# log "开始配置Agent启动的基础环境信息" +# rm -rf "$octopus_agent_path/lib/wdd-lib-env.sh" +# wget "${oss_url_prefix}/wdd-lib-env.sh" -qO "${octopus_agent_path}/lib/wdd-lib-env.sh" +# SplitGreen +# log "开始收集Agent主机的信息!" +# echo "" +# chmod +x "${octopus_agent_path}/lib/wdd-lib-env.sh" +# bash "${octopus_agent_path}/lib/wdd-lib-env.sh" + echo "写入备份octopus-server-info-conf文件!" + local agent_server_info_file="$octopus_agent_path/octopus-agent-back.conf" + + touch "$agent_server_info_file" + cat >"$agent_server_info_file" <"$agent_server_info_file" <