From 1081d963f838aff3e115e7d6db2226a920c482cb Mon Sep 17 00:00:00 2001 From: Bryce Larson Date: Wed, 17 Jun 2020 16:01:08 -0600 Subject: [PATCH] give more useful error message on download failure, make curl fail on failure --- bootstrap-salt.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 11675b2..488011c 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -792,11 +792,12 @@ fi #---------------------------------------------------------------------------------------------------------------------- __fetch_url() { # shellcheck disable=SC2086 - curl $_CURL_ARGS -L -s -o "$1" "$2" >/dev/null 2>&1 || + curl $_CURL_ARGS -L -s -f -o "$1" "$2" >/dev/null 2>&1 || wget $_WGET_ARGS -q -O "$1" "$2" >/dev/null 2>&1 || fetch $_FETCH_ARGS -q -o "$1" "$2" >/dev/null 2>&1 || # FreeBSD fetch -q -o "$1" "$2" >/dev/null 2>&1 || # Pre FreeBSD 10 - ftp -o "$1" "$2" >/dev/null 2>&1 # OpenBSD + ftp -o "$1" "$2" >/dev/null 2>&1 || # OpenBSD + (echoerror "$2 failed to download to $1"; exit 1) } #--- FUNCTION -------------------------------------------------------------------------------------------------------