From patchwork Mon Nov 12 19:12:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Always send hood to Monitoring From: Adrian Schmutzler X-Patchwork-Id: 949 Message-Id: <20181112191234.1767-1-freifunk@adrianschmutzler.de> To: franken-dev@freifunk.net Date: Mon, 12 Nov 2018 20:12:34 +0100 Since the MacNocker was introduced, the hood information in UCI is DELETED if the hood is lost. If the router still successfully sends alfred data in this state, the Monitoring will treat it as a V1 device. This is annoying, especially since it looks like a loop. An easy solution is to send an empty field in those cases, as V2 routers are detected by them knowing their hood. Signed-off-by: Adrian Schmutzler Reviewed-by: Tim Niemeyer --- src/packages/fff/fff-nodewatcher/Makefile | 2 +- src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/packages/fff/fff-nodewatcher/Makefile b/src/packages/fff/fff-nodewatcher/Makefile index 7f989fdb..927c6293 100644 --- a/src/packages/fff/fff-nodewatcher/Makefile +++ b/src/packages/fff/fff-nodewatcher/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fff-nodewatcher -PKG_VERSION:=49 +PKG_VERSION:=50 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) diff --git a/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher b/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher index b0b67e1a..9ca336e9 100755 --- a/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher +++ b/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher @@ -12,7 +12,7 @@ if ! lock -n "$lockfile"; then fi trap "lock -u \"$lockfile\"" INT TERM EXIT -SCRIPT_VERSION="49" +SCRIPT_VERSION="50" #Get the configuration from the uci configuration file #If it does not exists, then get it from a normal bash file with variables. @@ -146,10 +146,7 @@ crawl() { SYSTEM_DATA=$SYSTEM_DATA"${geo}" SYSTEM_DATA=$SYSTEM_DATA"${position_comment}" SYSTEM_DATA=$SYSTEM_DATA"${contact}" - if [ "$(uci -q get "system.@system[0].hood")" ] - then - SYSTEM_DATA=$SYSTEM_DATA"$(uci -q get "system.@system[0].hood")" - fi + SYSTEM_DATA=$SYSTEM_DATA"$(uci -q get "system.@system[0].hood")" SYSTEM_DATA=$SYSTEM_DATA"$distname" SYSTEM_DATA=$SYSTEM_DATA"$distversion" SYSTEM_DATA=$SYSTEM_DATA"$cpu"