From bea98d07491839b4ab1963e6a0341e8cab07ae16 Mon Sep 17 00:00:00 2001 From: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> Date: Tue, 18 Apr 2023 17:26:22 +0200 Subject: [PATCH] Enable exit on error immediately after download attempt (#7444) --- images/linux/scripts/helpers/install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/images/linux/scripts/helpers/install.sh b/images/linux/scripts/helpers/install.sh index 4c5c4d9c7..898d8d21a 100644 --- a/images/linux/scripts/helpers/install.sh +++ b/images/linux/scripts/helpers/install.sh @@ -28,6 +28,7 @@ download_with_retries() { set +e http_code=$(eval $COMMAND) exit_code=$? + set -e if [ $http_code -eq 200 ] && [ $exit_code -eq 0 ]; then echo "Download completed" return 0 @@ -35,8 +36,6 @@ download_with_retries() { echo "Error — Either HTTP response code for '$URL' is wrong - '$http_code' or exit code is not 0 - '$exit_code'. Waiting $interval seconds before the next attempt, $retries attempts left" sleep $interval fi - # Enable exit on error back - set -e done echo "Could not download $URL"