while loop
This commit is contained in:
parent
2d5987229b
commit
10cb46633b
@ -9,32 +9,22 @@ mapfile -t array < <(cli -m csv -c 'app chart_release query name,update_availabl
|
||||
update_limit=2
|
||||
current_updates=0
|
||||
|
||||
|
||||
while true
|
||||
it=0
|
||||
while [[ $it -lt ${#array[@]} ]]
|
||||
do
|
||||
if [[ current_updates -ge "$update_limit" ]]; then
|
||||
sleep 5
|
||||
jobs=$(jobs -p | wc -l)
|
||||
if [[ "$jobs" -ge "$update_limit" ]]; then
|
||||
sleep 3
|
||||
else
|
||||
for i in "${array[@]}"
|
||||
do
|
||||
{ update_apps "$i"; (( current_updates-- )) ;} & (( current_updates++ ))
|
||||
update_apps "${#array[$it]}" &
|
||||
processes+=($!)
|
||||
done
|
||||
((it++))
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for proc in "${processes[@]}"
|
||||
do
|
||||
wait "$proc"
|
||||
|
Loading…
Reference in New Issue
Block a user