huih
This commit is contained in:
parent
13a13cdbd7
commit
a12ead1bef
@ -1,6 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
current_updates=0
|
|
||||||
|
|
||||||
commander(){
|
commander(){
|
||||||
mapfile -t array < <(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,container_images_update_available,status' | tr -d " \t\r" | grep -E ",true($|,)" | sort)
|
mapfile -t array < <(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,container_images_update_available,status' | tr -d " \t\r" | grep -E ",true($|,)" | sort)
|
||||||
@ -8,17 +7,33 @@ mapfile -t array < <(cli -m csv -c 'app chart_release query name,update_availabl
|
|||||||
[[ -z $timeout ]] && echo -e "\nDefault Timeout: 500" && timeout=500 || echo -e "\nCustom Timeout: $timeout"
|
[[ -z $timeout ]] && echo -e "\nDefault Timeout: 500" && timeout=500 || echo -e "\nCustom Timeout: $timeout"
|
||||||
[[ "$timeout" -le 120 ]] && echo "Warning: Your timeout is set low and may lead to premature rollbacks or skips"
|
[[ "$timeout" -le 120 ]] && echo "Warning: Your timeout is set low and may lead to premature rollbacks or skips"
|
||||||
update_limit=2
|
update_limit=2
|
||||||
|
current_updates=0
|
||||||
|
|
||||||
|
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
if [[ current_updates -ge "$update_limit" ]]; then
|
||||||
|
sleep 5
|
||||||
|
else
|
||||||
for i in "${array[@]}"
|
for i in "${array[@]}"
|
||||||
do
|
do
|
||||||
update_apps "$i" && (( current_updates-- )) &
|
update_apps "$i" && (( current_updates-- )) & (( current_updates++ ))
|
||||||
(( current_updates++ ))
|
|
||||||
processes+=($!)
|
processes+=($!)
|
||||||
while [[ "$current_updates" -ge "$update_limit" ]]
|
|
||||||
do
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for proc in "${processes[@]}"
|
for proc in "${processes[@]}"
|
||||||
do
|
do
|
||||||
|
Loading…
Reference in New Issue
Block a user