From a3b6627ae945c11af92c8bb079bf4a12b8ae4c28 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Wed, 18 Jul 2018 18:10:35 +0200 Subject: sfeed_update: fail on feed HTTP redirect Make curl fail (return a non-zero exit status) on a HTTP redirect. This makes sure sfeed_update shows the feed as "FAILED" instead of succesful with zero data. --- sfeed_update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sfeed_update') diff --git a/sfeed_update b/sfeed_update index 6c4ed8d..c81ec6b 100755 --- a/sfeed_update +++ b/sfeed_update @@ -40,7 +40,7 @@ merge() { # fetch a feed via HTTP/HTTPS etc. # fetchfeed(url, name, feedfile) fetchfeed() { - if curl -H 'User-Agent:' -f -s -S --max-time 15 -z "$3" "$1"; then + if curl -L --max-redirs 0 -H 'User-Agent:' -f -s -S -m 15 -z "$3" "$1" 2>/dev/null; then printf " OK %s %s\n" "$(date +'%H:%M:%S')" "$2" >&2 else printf "FAIL %s %s\n" "$(date +'%H:%M:%S')" "$2" >&2 -- cgit v1.2.3