From fe1d2d7432847eba19ef80216de567fd7a914876 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Mon, 10 Sep 2018 18:54:13 +0200 Subject: 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. --- sfeed_update | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sfeed_update b/sfeed_update index 7578a1d..8ac5b32 100755 --- 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. -- cgit v1.2.3