From patchwork Sun Apr 19 13:40:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [3/4] nodewatcher: Only include subscripts result if executed successfully From: Fabian Blaese X-Patchwork-Id: 1349 Message-Id: <20200419134020.1389582-3-fabian@blaese.de> To: franken-dev@freifunk.net Date: Sun, 19 Apr 2020 15:40:19 +0200 If a subscript exits with an exit status != 0, its output should not be used. Therefore, it is discarded. Other scripts should not be affected by this, so the execution of nodewatcher is continued. Signed-off-by: Fabian Bläse --- src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher b/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher index 1226f49..f7b6778 100755 --- a/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher +++ b/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher @@ -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 $1, discarding its result!" + continue + fi DATA="$DATA$tmp" done