This commit is contained in:
Heavybullets8 2022-07-24 23:34:20 -06:00
parent 4fe1589aef
commit 9000d47a18

View File

@ -13,12 +13,14 @@ count=0
update_apps "$i" &
processes+=($!)
proc_count=0
count=$(jobs -p | wc -l)
while [[ "${#processes[@]}" -ge "$update_limit" ]]
do
echo "waiting for free space"
wait -n "${processes[$proc_count]}" &> /dev/null
for proc in "${processes[@]}"
do
kill -0 "$proc" || unset "processes[$proc_count]"
(( proc_count++ ))
unset "processes[$proc_count]"
done
done
done