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