From 5e23519ff536fff1494bf54999dc461bf0d2f621 Mon Sep 17 00:00:00 2001 From: zeaslity Date: Tue, 24 Oct 2023 10:14:39 +0800 Subject: [PATCH] =?UTF-8?q?[=20Agent=20]=20[=20Executor=20]=20-=20agent?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- agent-go/shell/agent-bootup.sh | 14 ++++++++------ agent-go/shell/{wdd-lib-env.sh => octopus-env.sh} | 0 2 files changed, 8 insertions(+), 6 deletions(-) rename agent-go/shell/{wdd-lib-env.sh => octopus-env.sh} (100%) diff --git a/agent-go/shell/agent-bootup.sh b/agent-go/shell/agent-bootup.sh index 0eea0dc..df926ff 100644 --- a/agent-go/shell/agent-bootup.sh +++ b/agent-go/shell/agent-bootup.sh @@ -2,6 +2,7 @@ #!/bin/bash OctopusAgentUrl=https://happybirthday.107421.xyz/octopus-agent/ +OctopusAgentShell=https://happybirthday.107421.xyz/octopus-agent/shell AgentConfigUrl=https://happybirthday.107421.xyz/agent-config/ OctopusAgentPath=/octopus-agent/shell ##### environment variables ###### @@ -25,7 +26,7 @@ SplitLine="----------------------" #会被sys函数中的方法重写 ######## 颜色函数方法很精妙 ############ colorEcho() { - echo -e "\033[${1}${@:2}\033[0m" 1>&2 + echo -e "\033[${1}${*:2}\033[0m" 1>&2 } ####################################### @@ -183,7 +184,7 @@ check_sys() { ## 安装所需要的程序,及依赖程序 installDemandSoftwares() { - for software in $@; do + for software in "$@"; do ## 安装该软件 if [[ -n $(command -v ${software}) ]]; then colorEcho ${GREEN} "${software}已经安装了...跳过..." @@ -348,10 +349,10 @@ CommonToolInstall() { echo "" if [[ ${LinuxReleaseVersion} == "centos" ]]; then centosCommonTool=(deltarpm net-tools iputils bind-utils lsof curl wget vim mtr htop) - installDemandSoftwares ${centosCommonTool[@]} + installDemandSoftwares "${centosCommonTool[@]}" elif [[ ${LinuxReleaseVersion} == "ubuntu" ]] || [[ ${LinuxReleaseVersion} == "debian" ]]; then ubuntuCommonTool=(iputils-ping net-tools dnsutils lsof curl wget mtr-tiny vim htop lrzsz) - installDemandSoftwares ${ubuntuCommonTool[@]} + installDemandSoftwares "${ubuntuCommonTool[@]}" fi FunctionEnd } @@ -369,8 +370,9 @@ BootUPAgent() { FunctionStart colorEcho $BLUE "开始配置Agent启动的基础环境信息!" - chmod +x $OctopusAgentPath/lib/wdd-lib-env.sh - $OctopusAgentPath/lib/wdd-lib-env.sh + wget ${OctopusAgentShell}/octopus-env.sh -qO $OctopusAgentPath/lib/octopus-env.sh + chmod +x $OctopusAgentPath/lib/octopus-env.sh + $OctopusAgentPath/lib/octopus-env.sh colorEcho $BLUE "start to daemon the octopus agent" systemdAgent diff --git a/agent-go/shell/wdd-lib-env.sh b/agent-go/shell/octopus-env.sh similarity index 100% rename from agent-go/shell/wdd-lib-env.sh rename to agent-go/shell/octopus-env.sh