From f4c7e90ceefcd1afc16af03e64b067fc4164d6a5 Mon Sep 17 00:00:00 2001 From: Bozhidar Slaveykov Date: Wed, 20 Mar 2024 13:32:07 +0200 Subject: [PATCH] Update download_file.sh --- sbin/download_file.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) mode change 100644 => 100755 sbin/download_file.sh diff --git a/sbin/download_file.sh b/sbin/download_file.sh old mode 100644 new mode 100755 index 6e19bac..ee0852b --- a/sbin/download_file.sh +++ b/sbin/download_file.sh @@ -13,5 +13,19 @@ zipDownloadedFile="$3"; echo "Download from url:" "$downloadUrl"; +#wget "$downloadUrl" -O "$zipDownloadedFile" + +# Retry 100 times +Retry=0 +until wget "$downloadUrl" -O "$zipDownloadedFile"; do + printf 'DOWNLOAD....\n' + sleep 2 + Retry=$((Retry+1)) + if [ $Retry -eq 100 ]; then + echo "Failed to download file after 100 retries" + exit 1 + fi +done + +echo "Downloaded file:" "$zipDownloadedFile"; -wget "$downloadUrl" -O "$zipDownloadedFile"