[ Agent ] [ Executor ] - fix bugs

This commit is contained in:
zeaslity
2023-10-24 14:04:52 +08:00
parent 1224dd8def
commit ebb0759737
4 changed files with 19 additions and 10 deletions

View File

@@ -277,9 +277,12 @@ CheckAndDownloadLatestVersion() {
echo ""
colorEcho $BLUE "start to download the agent config!"
agentConfigFileList=$(curl "$AgentConfigUrl/" | grep -v h1 | grep "a href=" | awk '{print$2}' | cut -d">" -f2 | cut -d"<" -f1 | cut -d"_" -f4-)
rm -rf index.html
agentConfigFileList=$(curl "$AgentConfigUrl/" | grep -v h1 | grep "a href=" | awk '{print$2}' | cut -d">" -f2 | cut -d"<" -f1 | cut -d"_" -f4- | tr "\n" " ")
for agentConfig in "${agentConfigFileList[@]}"; do
IFS=" " read -ra file_array <<<"$agentConfigFileList"
for agentConfig in "${file_array[@]}"; do
colorEcho $BLUE "agent config file is => $agentConfig"
wget -q "$AgentConfigUrl/$agentConfig"
echo ""