From 51a5e5fcc2c447c41aa3f47eaaf7aee32518c1c2 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Tue, 9 Aug 2022 22:47:59 -0600 Subject: [PATCH] better update handler --- functions/update_apps.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/functions/update_apps.sh b/functions/update_apps.sh index 7e1941a9..362cadab 100644 --- a/functions/update_apps.sh +++ b/functions/update_apps.sh @@ -134,14 +134,19 @@ update(){ count=0 while [[ $count -lt 3 ]] do - updated=$(grep "^$app_name," temp.txt | awk -F ',' '{print $3}') - if cli -c 'app chart_release upgrade release_name=''"'"$app_name"'"' &> /dev/null || [[ $updated == "false" ]]; then + update_avail=$(grep "^$app_name," temp.txt | awk -F ',' '{print $3}') + if [[ $update_avail == "true" ]]; then + if ! cli -c 'app chart_release upgrade release_name=''"'"$app_name"'"' &> /dev/null ; then + sleep 6 + ((count++)) + continue + fi + break + elif [[ $update_avail == "false" ]]; then break - elif [[ $count -lt 3 ]]; then - ((count++)) - sleep 5 else - return 1 + ((count++)) + sleep 6 fi done }