curl/wget downloads: set re-try count to 3

explicitly set the count to 3, so that a maximum of 3
attemps are made per download, barring fatal errors such
as http 404.

Signed-off-by: Leah Rowe <leah@libreboot.org>
btrfsvols
Leah Rowe 2023-09-04 22:12:02 +01:00
parent bdf171e3ec
commit 0d315c3a4e
2 changed files with 2 additions and 2 deletions

View File

@ -440,7 +440,7 @@ fetch_update()
[ -z "${x}" ] && continue
rm -f "${dl_path}" || \
err "fetch_update ${fw_type}: !rm -f ${dl_path}"
wget -U "${agent}" "${x}" -O "${dl_path}" || continue
wget --tries 3 -U "${agent}" "${x}" -O "${dl_path}" || continue
vendor_checksum "${dlsum}" && dl_fail="n"
done
if [ "${dl_fail}" = "y" ]; then

View File

@ -111,7 +111,7 @@ download_image()
_sha1sum=${3}
printf "Downloading recovery image\n"
curl "$url" > "$_file.zip" || err "download_image: curl failed"
curl --retry 3 "$url" > "$_file.zip" || err "download_image: curl failed"
printf "Verifying recovery image checksum\n"
if [ "$(sha1sum "${_file}.zip" | awk '{print $1}')" = "${_sha1sum}" ]
then