commit fe1d2d7432847eba19ef80216de567fd7a914876
parent 5777f9515649ac48ba610cbbf26740cc77bb0531
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Mon, 10 Sep 2018 18:54:13 +0200
sfeed_update: reorder loadconfig and signal handler setup
... this is useful to change the interrupted behaviour in some use-cases.
Thanks leot for the feedback.
Diffstat:
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/sfeed_update b/sfeed_update
@@ -97,30 +97,30 @@ feed() {
fi) &
}
-interrupted() {
- isinterrupted="1"
-}
-
cleanup() {
# remove temporary files
rm -rf "${sfeedtmpdir}"
}
+interrupted() {
+ isinterrupted="1"
+}
+
feeds() {
echo "Configuration file \"${config}\" is invalid or does not contain a \"feeds\" function." >&2
echo "See sfeedrc.example for an example." >&2
}
-# load config file.
-loadconfig "$1"
-# fetch feeds and store in temporary file.
-sfeedtmpdir="$(mktemp -d '/tmp/sfeed_XXXXXX')"
# kill whole current process group on ^C (SIGINT).
isinterrupted="0"
# SIGTERM: signal to terminate parent.
trap -- "interrupted" "15"
# SIGINT: kill all running childs >:D
trap -- "kill -TERM -$$" "2"
+# load config file.
+loadconfig "$1"
+# fetch feeds and store in temporary file.
+sfeedtmpdir="$(mktemp -d '/tmp/sfeed_XXXXXX')"
# make sure path exists.
mkdir -p "${sfeedpath}"
# fetch feeds specified in config file.