summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2023-04-05 21:41:19 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2023-04-05 21:41:19 +0200
commit5a27c58675ddf4113d64a84f715cb3fecb681a6d (patch)
treeb7260cf41d14fbd0c9ae7c13705b043d2befcb06
parent92dfc055ce7a24bc8120c7eece3caca0ae84b653 (diff)
sfeed_update: fail early if creating a temporary directory or status file fails
If creating a temporary directory for the feed files failed then $sfeedtmpdir would be empty and it would try to: mkdir -p "/feed" touch "/feed/ok" After failing it would also still try to process all the feeds. Now just fail early. mktemp or touch themselve will print the actual error to stderr.
-rwxr-xr-xsfeed_update4
1 files changed, 2 insertions, 2 deletions
diff --git a/sfeed_update b/sfeed_update
index f989be6..3da45d3 100755
--- a/sfeed_update
+++ b/sfeed_update
@@ -203,9 +203,9 @@ main() {
# load config file.
loadconfig "$1"
# fetch feeds and store in temporary directory.
- sfeedtmpdir="$(mktemp -d '/tmp/sfeed_XXXXXX')"
+ sfeedtmpdir="$(mktemp -d '/tmp/sfeed_XXXXXX')" || exit 1
mkdir -p "${sfeedtmpdir}/feeds"
- touch "${sfeedtmpdir}/ok"
+ touch "${sfeedtmpdir}/ok" || exit 1
# make sure path exists.
mkdir -p "${sfeedpath}"
# fetch feeds specified in config file.