This commit is contained in:
Heavybullets8 2022-08-08 23:59:32 -06:00
parent 053d971f7a
commit fbfce5ce26

View File

@ -14,7 +14,7 @@ it=0
while_status=$(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,status' 2>/dev/null) > temp.txt while_status=$(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,status' 2>/dev/null) > temp.txt
while true while true
do do
if [ ! -e "$file" ] ; then if [ ! -e trigger ] ; then
while_status=$(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,status' 2>/dev/null) while_status=$(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,status' 2>/dev/null)
echo "$while_status" > temp.txt echo "$while_status" > temp.txt
fi fi
@ -28,14 +28,12 @@ do
if [[ "$proc_count" -ge "$update_limit" ]]; then if [[ "$proc_count" -ge "$update_limit" ]]; then
sleep 6 sleep 6
elif [[ $it -lt ${#array[@]} ]]; then elif [[ $it -lt ${#array[@]} ]]; then
ttl=0
until [[ "$proc_count" -ge "$update_limit" || $it -ge ${#array[@]} ]] until [[ "$proc_count" -ge "$update_limit" || $it -ge ${#array[@]} ]]
do do
update_apps "${array[$it]}" & update_apps "${array[$it]}" &
processes+=($!) processes+=($!)
((it++)) ((it++))
((proc_count++)) ((proc_count++))
((ttl++))
done done
elif [[ $proc_count != 0 ]]; then # Wait for all processes to finish elif [[ $proc_count != 0 ]]; then # Wait for all processes to finish
sleep 6 sleep 6