nodewatcher: Exit nodewatcher if subscript fails

If a subscript exits with an exit status != 0, its output should not
be used. Because sending incomplete data sets might result in weird
edge cases, the nodewatcher is terminated and the output of other
subscripts is discarded.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Fabian Bläse 2020-04-22 16:05:27 +02:00
parent 25c5edcf3c
commit f26463628b
1 changed files with 4 additions and 0 deletions

View File

@ -29,6 +29,10 @@ crawl() {
for f in /usr/lib/nodewatcher.d/*.sh; do
tmp="$($f)"
if [ $? -ne 0 ]; then
debug "Error when executing subscript $f, exiting!"
exit 1
fi
DATA="$DATA$tmp"
done