From 5ba496ca2183439bfff3434f59284c789c003c40 Mon Sep 17 00:00:00 2001 From: luca0N! Date: Tue, 28 Oct 2025 23:13:22 -0300 Subject: [PATCH] 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. --- prefsCleaner.sh | 2 +- updater.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/prefsCleaner.sh b/prefsCleaner.sh index b9739b2..2d89b29 100755 --- a/prefsCleaner.sh +++ b/prefsCleaner.sh @@ -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 diff --git a/updater.sh b/updater.sh index 72c77fc..cdced8e 100755 --- a/updater.sh +++ b/updater.sh @@ -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