From 25c5edcf3c1ca8a88f62f8ad3f3b426e0f2f8aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Wed, 22 Apr 2020 16:05:26 +0200 Subject: [PATCH] nodewatcher: Add prefix to debug messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because nodewatcher is executed using a cron, but our cron has no way to report the origin of a specific log entry, a 'nodewatcher:' prefix is added to all debug output. Signed-off-by: Fabian Bläse Reviewed-by: Adrian Schmutzler --- .../fff-batman-adv/files/usr/lib/nodewatcher.d/30-batman-adv.sh | 2 +- .../fff-network/files/usr/lib/nodewatcher.d/20-interfaces.sh | 2 +- .../fff/fff-network/files/usr/lib/nodewatcher.d/50-clients.sh | 2 +- .../files/usr/lib/nodewatcher.d/10-systemdata.sh | 2 +- src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/packages/fff/fff-batman-adv/files/usr/lib/nodewatcher.d/30-batman-adv.sh b/src/packages/fff/fff-batman-adv/files/usr/lib/nodewatcher.d/30-batman-adv.sh index 96397616..62711595 100755 --- a/src/packages/fff/fff-batman-adv/files/usr/lib/nodewatcher.d/30-batman-adv.sh +++ b/src/packages/fff/fff-batman-adv/files/usr/lib/nodewatcher.d/30-batman-adv.sh @@ -3,7 +3,7 @@ # License; GPL v3 debug() { - (>&2 echo "$1") + (>&2 echo "nodewatcher: $1") } debug "Collecting information from batman advanced and its interfaces" diff --git a/src/packages/fff/fff-network/files/usr/lib/nodewatcher.d/20-interfaces.sh b/src/packages/fff/fff-network/files/usr/lib/nodewatcher.d/20-interfaces.sh index 44d2cea7..ba7f02f6 100755 --- a/src/packages/fff/fff-network/files/usr/lib/nodewatcher.d/20-interfaces.sh +++ b/src/packages/fff/fff-network/files/usr/lib/nodewatcher.d/20-interfaces.sh @@ -6,7 +6,7 @@ IFACEBLACKLIST=$(uci get nodewatcher.@network[0].iface_blacklist) IPWHITELIST=$(uci get nodewatcher.@network[0].ip_whitelist) debug() { - (>&2 echo "$1") + (>&2 echo "nodewatcher: $1") } inArray() { diff --git a/src/packages/fff/fff-network/files/usr/lib/nodewatcher.d/50-clients.sh b/src/packages/fff/fff-network/files/usr/lib/nodewatcher.d/50-clients.sh index aca3db2a..1d5cd832 100755 --- a/src/packages/fff/fff-network/files/usr/lib/nodewatcher.d/50-clients.sh +++ b/src/packages/fff/fff-network/files/usr/lib/nodewatcher.d/50-clients.sh @@ -5,7 +5,7 @@ MESH_INTERFACE=$(uci get nodewatcher.@network[0].mesh_interface) debug() { - (>&2 echo "$1") + (>&2 echo "nodewatcher: $1") } debug "Collecting information about connected clients" diff --git a/src/packages/fff/fff-nodewatcher/files/usr/lib/nodewatcher.d/10-systemdata.sh b/src/packages/fff/fff-nodewatcher/files/usr/lib/nodewatcher.d/10-systemdata.sh index 0f495f8d..65f4cb3c 100755 --- a/src/packages/fff/fff-nodewatcher/files/usr/lib/nodewatcher.d/10-systemdata.sh +++ b/src/packages/fff/fff-nodewatcher/files/usr/lib/nodewatcher.d/10-systemdata.sh @@ -6,7 +6,7 @@ SCRIPT_STATUS_FILE=$(uci get nodewatcher.@script[0].status_text_file) SCRIPT_VERSION=$(cat /etc/nodewatcher_version) debug() { - (>&2 echo "$1") + (>&2 echo "nodewatcher: $1") } debug "Collecting basic system status data" diff --git a/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher b/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher index 8cee7ce1..8b556566 100755 --- a/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher +++ b/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher @@ -17,7 +17,7 @@ trap "lock -u \"$lockfile\"" INT TERM EXIT SCRIPT_DATA_FILE=$(uci get nodewatcher.@script[0].data_file) debug() { - (>&2 echo "$1") + (>&2 echo "nodewatcher: $1") } #This method generates the crawl data XML file that is being fetched by netmon