mirror of
https://github.com/arkenfox/user.js.git
synced 2025-11-23 05:11:03 -05:00
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:
parent
9103afafff
commit
5ba496ca21
2 changed files with 2 additions and 2 deletions
|
|
@ -23,7 +23,7 @@ QUICKSTART=false
|
|||
## download method priority: curl -> wget
|
||||
DOWNLOAD_METHOD=''
|
||||
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
|
||||
DOWNLOAD_METHOD='wget --max-redirect 3 --quiet -O'
|
||||
else
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ ESR=false
|
|||
# Download method priority: curl -> wget
|
||||
DOWNLOAD_METHOD=''
|
||||
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
|
||||
DOWNLOAD_METHOD='wget --max-redirect 3 --quiet -O'
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue