From fd21a80db09334840e54d7319cdcc68691461fea Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 27 Jul 2022 15:07:53 -0600 Subject: [PATCH] test --- functions/update_apps.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/functions/update_apps.sh b/functions/update_apps.sh index 472ded56..a856a945 100644 --- a/functions/update_apps.sh +++ b/functions/update_apps.sh @@ -21,6 +21,7 @@ do for proc in "${processes[@]}" do kill -0 "$proc" &> /dev/null || { unset "processes[$count]"; ((proc_count--)); } + ((count++)) done if [[ "$proc_count" -ge "$update_limit" ]]; then sleep 3 @@ -28,9 +29,10 @@ do update_apps "${array[$it]}" & processes+=($!) ((it++)) - elif [[ ${#processes[@]} != 0 ]]; then # Wait for all processes to finish + elif [[ $proc_count != 0 ]]; then # Wait for all processes to finish sleep 3 - else + else # All processes must be completed, break out of loop + wait "${processes[*]}" break fi done