From 2fd4d0a92698f18cb9c4b93f6ee4fdca150c960e Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 27 Jul 2022 14:13:40 -0600 Subject: [PATCH] test --- functions/update_apps.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/functions/update_apps.sh b/functions/update_apps.sh index f609ef01..efb9d9a3 100644 --- a/functions/update_apps.sh +++ b/functions/update_apps.sh @@ -12,7 +12,7 @@ echo "Asynchronous Updates: $update_limit" touch temp.txt it=0 -while [[ $it -lt ${#array[@]} ]] +while true do cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,status' > temp.txt proc_count=${#processes[@]} @@ -23,18 +23,20 @@ do done if [[ "$proc_count" -ge "$update_limit" ]]; then sleep 3 - else + elif [[ $it -lt ${#array[@]} ]]; then update_apps "${array[$it]}" & processes+=($!) ((it++)) + else + for proc in "${processes[@]}" + do + wait "$proc" + done + break fi done rm temp.txt -for proc in "${processes[@]}" -do - wait "$proc" -done } export -f commander