aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-12-17 11:48:25 +0100
committerGravatar Christian Hesse <mail@eworm.de>2021-12-17 11:48:25 +0100
commitee57ddf595851d0068730bea2ef1b55752b6d7bc (patch)
treea07dde531f323c937e85be2ebc47c387a78d558f
parentb936970c19b960294b4cbadfcfe1f917d7762d0d (diff)
log-forward: fix forwarding first message
Pulling the power cable results in log message on next boot: dec/16 18:28:28 system,error,critical router rebooted without proper shutdown, probably power outage This was not forwarded as it had the numeric id 0, which is not greater than the zero we initialized with. Now initialized with -1 when no log has been forwarded to fix this.
-rw-r--r--log-forward2
1 files changed, 1 insertions, 1 deletions
diff --git a/log-forward b/log-forward
index e0cb3aa..03b408d 100644
--- a/log-forward
+++ b/log-forward
@@ -44,7 +44,7 @@ $WaitFullyConnected;
:local Count 0;
:local Duplicates false;
-:local Last [ $HexToNum $LogForwardLast ];
+:local Last [ $IfThenElse ([ :len $LogForwardLast ] > 0) [ $HexToNum $LogForwardLast ] -1 ];
:local Messages "";
:local MessageVal;
:local MessageDups [ :toarray "" ];