diff options
author | Leah Rowe <leah@libreboot.org> | 2024-06-09 10:58:19 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2024-06-09 10:58:19 +0100 |
commit | 75b39dbeb15c7ac0a942da84d1c0784e80b51156 (patch) | |
tree | 6ffaca8e200cb9edbd667d7017d4115255103f53 | |
parent | 26df6e7ab29cc745e40beae867310089fe0a7cf3 (diff) |
lib.sh: fix redundancy in download()
it was only downloading the main url, even when
it should use the backup.
fix it by actually using the for loop variable.
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rwxr-xr-x | include/lib.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/lib.sh b/include/lib.sh index fa15bd6a..25b470bf 100755 --- a/include/lib.sh +++ b/include/lib.sh @@ -235,10 +235,10 @@ download() x_ mkdir -p "${3%/*}" for url in "$1" "$2"; do [ "$dl_fail" = "n" ] && break - [ -z "$1" ] && continue + [ -z "$url" ] && continue x_ rm -f "$3" - curl --location --retry 3 -A "$_ua" "$1" -o "$3" || \ - wget --tries 3 -U "$_ua" "$1" -O "$3" || continue + curl --location --retry 3 -A "$_ua" "$url" -o "$3" || \ + wget --tries 3 -U "$_ua" "$url" -O "$3" || continue vendor_checksum "$4" "$3" || dl_fail="n" done [ "$dl_fail" = "y" ] && $err "$1 $2 $3 $4: file missing"; return 0 |