diff options
Diffstat (limited to 'coin/provisioning/common/unix/DownloadURL.sh')
-rwxr-xr-x | coin/provisioning/common/unix/DownloadURL.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/coin/provisioning/common/unix/DownloadURL.sh b/coin/provisioning/common/unix/DownloadURL.sh index 2d82af58..996c99da 100755 --- a/coin/provisioning/common/unix/DownloadURL.sh +++ b/coin/provisioning/common/unix/DownloadURL.sh @@ -40,6 +40,8 @@ # If called directly from another script, it will exit the parent script # as well, if not called in its own subshell with parentheses. +set -ex + function DownloadURL { url=$1 url_alt=$2 @@ -47,11 +49,11 @@ function DownloadURL { targetFile=$4 echo "Downloading from primary URL '$url'" - curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url" || ( + curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url" || { echo "Failed to download '$url' multiple times" echo "Downloading from alternative URL '$url_alt'" - curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url_alt" - ) + curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url_alt" || { echo 'Failed to download even from alternative url'; exit 1; } + } echo "Checking SHA1 on PKG '$targetFile'" echo "$expectedSha1 *$targetFile" > "$targetFile.sha1" |