From 556e1b1c71723ff095cd90e1fa3e139956decfc9 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Thu, 27 Jun 2024 09:26:56 +0200 Subject: [PATCH] fix: retry download --- src/usr/local/containerbase/utils/cache.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/usr/local/containerbase/utils/cache.sh b/src/usr/local/containerbase/utils/cache.sh index 5051c8e7b..7b6168178 100644 --- a/src/usr/local/containerbase/utils/cache.sh +++ b/src/usr/local/containerbase/utils/cache.sh @@ -92,8 +92,13 @@ function download_file () { retry=$((retry-1)) if ! log=$(containerbase-cli df "${url}" "${temp_folder}/${name}"); then echo "Download failed: ${url}" >&2 - echo "${log}" >&2 - exit 1 + if [ "${retry}" -le 0 ]; then + echo "Download failed: ${url}" >&2 + echo "${log}" >&2 + exit 1 + fi + echo "Download failed, retrying" >&2 + continue fi; # verify checksum if given