download.pl: fix detecting download errors with curl
authorFelix Fietkau <nbd@nbd.name>
Tue, 31 Jan 2017 10:22:21 +0000 (11:22 +0100)
committerFelix Fietkau <nbd@nbd.name>
Tue, 31 Jan 2017 10:25:18 +0000 (11:25 +0100)
Avoid treating error pages as successfully downloaded content

Signed-off-by: Felix Fietkau <nbd@nbd.name>
scripts/download.pl

index 0398c56..7eb7c7e 100755 (executable)
@@ -82,7 +82,7 @@ sub download_cmd($) {
        }
 
        return $have_curl
-               ? (qw(curl --connect-timeout 20 --retry 5 --location --insecure), shellwords($ENV{CURL_OPTIONS} || ''), $url)
+               ? (qw(curl -f --connect-timeout 20 --retry 5 --location --insecure), shellwords($ENV{CURL_OPTIONS} || ''), $url)
                : (qw(wget --tries=5 --timeout=20 --no-check-certificate --output-document=-), shellwords($ENV{WGET_OPTIONS} || ''), $url)
        ;
 }