From 2eb675790e877a3ea4411e67a88e6888ef60ac42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Wed, 22 Apr 2020 16:05:25 +0200 Subject: [PATCH] nodewatcher.d: Remove $(date) from debug output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Debug output is written to stderr now. Therefore the output is happening in real time and the current date and time are not necessary anymore. Typically the date and time are added by the syslog daemon. Signed-off-by: Fabian Bläse Reviewed-by: Adrian Schmutzler --- .../files/usr/lib/nodewatcher.d/30-batman-adv.sh | 4 ++-- .../files/usr/lib/nodewatcher.d/20-interfaces.sh | 2 +- .../fff-network/files/usr/lib/nodewatcher.d/50-clients.sh | 2 +- .../files/usr/lib/nodewatcher.d/10-systemdata.sh | 6 +++--- src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher | 4 ++-- 5 files changed, 9 insertions(+), 9 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 5fe4d89a..96397616 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 @@ -6,7 +6,7 @@ debug() { (>&2 echo "$1") } -debug "$(date): Collecting information from batman advanced and its interfaces" +debug "Collecting information from batman advanced and its interfaces" if [ -f /sys/module/batman_adv/version ]; then for iface in $(batctl if | sed 's/ //'); do @@ -53,7 +53,7 @@ if [ -f /sys/module/batman_adv/version ]; then echo -n "$batman_adv_gateway_list" else - debug "$(date): No batman data .." + debug "No batman data .." exit 1 fi 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 acb1eeeb..44d2cea7 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 @@ -17,7 +17,7 @@ inArray() { return 1 } -debug "$(date): Collecting information from network interfaces" +debug "Collecting information from network interfaces" interface_data="" 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 c4a0a614..aca3db2a 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 @@ -8,7 +8,7 @@ debug() { (>&2 echo "$1") } -debug "$(date): Collecting information about connected clients" +debug "Collecting information about connected clients" client_count=0 dataclient="" 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 c9a315e2..0f495f8d 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 @@ -9,7 +9,7 @@ debug() { (>&2 echo "$1") } -debug "$(date): Collecting basic system status data" +debug "Collecting basic system status data" SYSTEM_DATA="online" @@ -59,7 +59,7 @@ SYSTEM_DATA="$SYSTEM_DATA$(date +%s)" load=$(awk '{ printf ""$3""$4"" }' /proc/loadavg) SYSTEM_DATA="$SYSTEM_DATA$load" -debug "$(date): Collecting version information" +debug "Collecting version information" SYSTEM_DATA="$SYSTEM_DATA$(cat /sys/module/batman_adv/version)" SYSTEM_DATA="$SYSTEM_DATA$(uname -r)" @@ -95,7 +95,7 @@ SYSTEM_DATA="$SYSTEM_DATA$BUILD_DATE" SYSTEM_DATA="$SYSTEM_DATA$OPENWRT_CORE_REVISION" SYSTEM_DATA="$SYSTEM_DATA$OPENWRT_FEEDS_PACKAGES_REVISION" -debug "$(date): Collecting hood information and additional status data" +debug "Collecting hood information and additional status data" SYSTEM_DATA="$SYSTEM_DATA$(uci -q get "system.@system[0].hood")" SYSTEM_DATA="$SYSTEM_DATA$(uci -q get "system.@system[0].hoodid")" diff --git a/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher b/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher index 51b3e9eb..8cee7ce1 100755 --- a/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher +++ b/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher @@ -23,7 +23,7 @@ debug() { #This method generates the crawl data XML file that is being fetched by netmon #and provided by a small local httpd crawl() { - debug "$(date): Putting all information into a XML-File and save it at $SCRIPT_DATA_FILE" + debug "Putting all information into a XML-File and save it at $SCRIPT_DATA_FILE" DATA="" @@ -43,7 +43,7 @@ crawl() { LANG=C #Erzeugt die statusdaten -debug "$(date): Generate actual status data" +debug "Generate actual status data" crawl exit 0