mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 09:40:21 +00:00
give more useful error message on download failure, make curl fail on failure
This commit is contained in:
parent
1e86c22c96
commit
1081d963f8
1 changed files with 3 additions and 2 deletions
|
@ -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 -------------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Reference in a new issue