forked from freifunk-franken/firmware
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:
parent
25c5edcf3c
commit
f26463628b
|
@ -29,6 +29,10 @@ crawl() {
|
||||||
|
|
||||||
for f in /usr/lib/nodewatcher.d/*.sh; do
|
for f in /usr/lib/nodewatcher.d/*.sh; do
|
||||||
tmp="$($f)"
|
tmp="$($f)"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
debug "Error when executing subscript $f, exiting!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
DATA="$DATA$tmp"
|
DATA="$DATA$tmp"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user