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