[ agent ] 去除本地文件

This commit is contained in:
zeaslity
2024-04-28 16:40:53 +08:00
parent 97cadb9b7a
commit 1b11d6b45c
2 changed files with 39 additions and 10 deletions

View File

@@ -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" <<EOF
serverName: ""
serverIpPbV4: ""
serverIpInV4: ""
serverIpPbV6: ""
serverIpInV6: ""
location: ""
provider: ""
managePort: ""
cpuCore: ""
cpuBrand: ""
memoryTotal: "$"
diskTotal: "$"
diskUsage: "$"
archInfo: ""
osInfo: ""
osKernelInfo: ""
tcpControl: ""
virtualization: ""
ioSpeed: ""
machineId: ""
agentVersion: ""
EOF
echo ""
SplitGreen

View File

@@ -583,7 +583,7 @@ main() {
get_agent_version
local agent_server_info_file="$octopus_agent_path/octopus-agent.conf"
local agent_server_info_file="$octopus_agent_path/octopus-agent-back.conf"
touch "$agent_server_info_file"
cat >"$agent_server_info_file" <<EOF