Fail curl request on HTTP error status

Use the `-f' option to instruct curl to exit with a non-zero exit code
if the HTTP response indicates an error via its status code.  This is
the default behavior for wget, but curl will send the request and exit
normally (with exit code equals to zero), as long as it's received a
response from the server.
This commit is contained in:
luca0N! 2025-10-28 23:13:22 -03:00
parent 9103afafff
commit 5ba496ca21
No known key found for this signature in database
GPG key ID: 5978D960572B449E
2 changed files with 2 additions and 2 deletions

View file

@ -23,7 +23,7 @@ QUICKSTART=false
## download method priority: curl -> wget ## download method priority: curl -> wget
DOWNLOAD_METHOD='' DOWNLOAD_METHOD=''
if command -v curl >/dev/null; then if command -v curl >/dev/null; then
DOWNLOAD_METHOD='curl --max-redirs 3 -so' DOWNLOAD_METHOD='curl --max-redirs 3 -fso'
elif command -v wget >/dev/null; then elif command -v wget >/dev/null; then
DOWNLOAD_METHOD='wget --max-redirect 3 --quiet -O' DOWNLOAD_METHOD='wget --max-redirect 3 --quiet -O'
else else

View file

@ -48,7 +48,7 @@ ESR=false
# Download method priority: curl -> wget # Download method priority: curl -> wget
DOWNLOAD_METHOD='' DOWNLOAD_METHOD=''
if command -v curl >/dev/null; then if command -v curl >/dev/null; then
DOWNLOAD_METHOD='curl --max-redirs 3 -so' DOWNLOAD_METHOD='curl --max-redirs 3 -fso'
elif command -v wget >/dev/null; then elif command -v wget >/dev/null; then
DOWNLOAD_METHOD='wget --max-redirect 3 --quiet -O' DOWNLOAD_METHOD='wget --max-redirect 3 --quiet -O'
else else