summaryrefslogtreecommitdiff
path: root/sfeed_update
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2018-07-18 18:10:35 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2018-07-18 18:10:35 +0200
commita3b6627ae945c11af92c8bb079bf4a12b8ae4c28 (patch)
tree67874fe213cc32a1ac81a4f63522a39c5929f7f1 /sfeed_update
parent105a067b48a2e258b39e20a7b74078f2ebb6d8f0 (diff)
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.
Diffstat (limited to 'sfeed_update')
-rwxr-xr-xsfeed_update2
1 files changed, 1 insertions, 1 deletions
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