Always send hood to Monitoring

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 <hood> field in those cases,
as V2 routers are detected by them knowing their hood.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
This commit is contained in:
Adrian Schmutzler 2018-11-12 20:12:34 +01:00
parent eed0705407
commit a37dedda26
2 changed files with 3 additions and 6 deletions

View File

@ -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)

View File

@ -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"<hood>$(uci -q get "system.@system[0].hood")</hood>"
fi
SYSTEM_DATA=$SYSTEM_DATA"<hood>$(uci -q get "system.@system[0].hood")</hood>"
SYSTEM_DATA=$SYSTEM_DATA"<distname>$distname</distname>"
SYSTEM_DATA=$SYSTEM_DATA"<distversion>$distversion</distversion>"
SYSTEM_DATA=$SYSTEM_DATA"$cpu"