[ agent ] 去除本地文件
This commit is contained in:
@@ -910,7 +910,7 @@ SyslogIdentifier=octopus-agent
|
|||||||
User=root
|
User=root
|
||||||
Type=simple
|
Type=simple
|
||||||
WorkingDirectory=$octopus_agent_path
|
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
|
ExecStop=/bin/kill -15 \$MAINPID
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
@@ -927,6 +927,8 @@ EOF
|
|||||||
rsyslogd -N1 -f /etc/rsyslog.d/octopus-agent.conf
|
rsyslogd -N1 -f /etc/rsyslog.d/octopus-agent.conf
|
||||||
systemctl restart rsyslog
|
systemctl restart rsyslog
|
||||||
|
|
||||||
|
colorEchoGreen "Agent守护程序设置成功!"
|
||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1019,14 +1021,41 @@ install_octopus_agent() {
|
|||||||
ls ${octopus_agent_path} | grep ".yaml"
|
ls ${octopus_agent_path} | grep ".yaml"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
log "开始配置Agent启动的基础环境信息"
|
# log "开始配置Agent启动的基础环境信息"
|
||||||
rm -rf "$octopus_agent_path/lib/wdd-lib-env.sh"
|
# 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"
|
# wget "${oss_url_prefix}/wdd-lib-env.sh" -qO "${octopus_agent_path}/lib/wdd-lib-env.sh"
|
||||||
SplitGreen
|
# SplitGreen
|
||||||
log "开始收集Agent主机的信息!"
|
# log "开始收集Agent主机的信息!"
|
||||||
echo ""
|
# echo ""
|
||||||
chmod +x "${octopus_agent_path}/lib/wdd-lib-env.sh"
|
# chmod +x "${octopus_agent_path}/lib/wdd-lib-env.sh"
|
||||||
bash "${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 ""
|
echo ""
|
||||||
SplitGreen
|
SplitGreen
|
||||||
|
|
||||||
|
|||||||
@@ -583,7 +583,7 @@ main() {
|
|||||||
|
|
||||||
get_agent_version
|
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"
|
touch "$agent_server_info_file"
|
||||||
cat >"$agent_server_info_file" <<EOF
|
cat >"$agent_server_info_file" <<EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user