summaryrefslogtreecommitdiff
path: root/sfeed_update
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2018-10-11 19:08:31 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2018-10-11 19:08:31 +0200
commit8699fa2bb4c75670952fee503a58ca4a652627eb (patch)
tree9a478b576ce8e86f27c19a4a165fea8a0b1764fb /sfeed_update
parente6f4940e5f0fd9e2f53bdc4bac47a1f533f13185 (diff)
sfeed_update: replace non-POSIX mktemp with $$
+ fix wrong comment "temporary file" -> "temporary directory".
Diffstat (limited to 'sfeed_update')
-rwxr-xr-xsfeed_update8
1 files changed, 5 insertions, 3 deletions
diff --git a/sfeed_update b/sfeed_update
index 5ee99ee..374ad5c 100755
--- a/sfeed_update
+++ b/sfeed_update
@@ -5,6 +5,9 @@
# defaults
sfeedpath="$HOME/.sfeed/feeds"
+# temporary directory.
+sfeedtmpdir="/tmp/sfeed_$$"
+
# used for processing feeds concurrently: wait until ${maxjobs} amount of
# feeds are finished at a time.
maxjobs=8
@@ -147,9 +150,8 @@ trap -- "sighandler 2" "INT"
trap -- "sighandler 15" "TERM"
# load config file.
loadconfig "$1"
-# fetch feeds and store in temporary file.
-sfeedtmpdir="$(mktemp -d '/tmp/sfeed_XXXXXX')"
-# make sure path exists.
+# make sure sfeed path and temporary directory exist.
+mkdir -m 700 -p "${sfeedtmpdir}"
mkdir -p "${sfeedpath}"
# fetch feeds specified in config file.
feeds