error message on failed update

This commit is contained in:
Heavybullets8 2022-08-09 17:46:59 -06:00
parent 495205253a
commit b8616e988c

View File

@ -78,7 +78,12 @@ if [[ "$diff_app" == "$diff_chart" || "$update_all_apps" == "true" ]]; then #con
if [[ "$startstatus" == "STOPPED" ]]; then # if status is already stopped, skip while loop if [[ "$startstatus" == "STOPPED" ]]; then # if status is already stopped, skip while loop
echo_array+=("\n$app_name") echo_array+=("\n$app_name")
[[ "$verbose" == "true" ]] && echo_array+=("Updating..") [[ "$verbose" == "true" ]] && echo_array+=("Updating..")
update if update ;then
echo_array+=("Updated\n$old_full_ver\n$new_full_ver")
else
echo_array+=("Failed to update")
return
fi
else # if status was not STOPPED, stop the app prior to updating else # if status was not STOPPED, stop the app prior to updating
echo_array+=("\n$app_name") echo_array+=("\n$app_name")
[[ "$verbose" == "true" ]] && echo_array+=("Stopping prior to update..") [[ "$verbose" == "true" ]] && echo_array+=("Stopping prior to update..")
@ -91,7 +96,12 @@ if [[ "$diff_app" == "$diff_chart" || "$update_all_apps" == "true" ]]; then #con
if [[ "$status" == "STOPPED" ]]; then if [[ "$status" == "STOPPED" ]]; then
echo_array+=("Stopped") echo_array+=("Stopped")
[[ "$verbose" == "true" ]] && echo_array+=("Updating..") [[ "$verbose" == "true" ]] && echo_array+=("Updating..")
update if update ;then
echo_array+=("Updated\n$old_full_ver\n$new_full_ver")
else
echo_array+=("Failed to update")
return
fi
elif [[ "$SECONDS" -ge "$timeout" ]]; then elif [[ "$SECONDS" -ge "$timeout" ]]; then
echo_array+=("Error: Run Time($SECONDS) has exceeded Timeout($timeout)") echo_array+=("Error: Run Time($SECONDS) has exceeded Timeout($timeout)")
break break
@ -104,7 +114,12 @@ if [[ "$diff_app" == "$diff_chart" || "$update_all_apps" == "true" ]]; then #con
else #user must not be using -S, just update else #user must not be using -S, just update
echo_array+=("\n$app_name") echo_array+=("\n$app_name")
[[ "$verbose" == "true" ]] && echo_array+=("Updating..") [[ "$verbose" == "true" ]] && echo_array+=("Updating..")
update if update ;then
echo_array+=("Updated\n$old_full_ver\n$new_full_ver")
else
echo_array+=("Failed to update")
return
fi
fi fi
else else
echo -e "\n$app_name\nMajor Release, update manually" echo -e "\n$app_name\nMajor Release, update manually"
@ -121,10 +136,8 @@ while [[ $count -lt 3 ]]
do do
updated=$(grep "^$app_name," temp.txt | awk -F ',' '{print $3}') 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 if cli -c 'app chart_release upgrade release_name=''"'"$app_name"'"' &> /dev/null || [[ $updated == "false" ]]; then
echo_array+=("Updated\n$old_full_ver\n$new_full_ver")
break break
else else
echo_array+=("Failed, trying again..")
((count++)) ((count++))
sleep 5 sleep 5
fi fi