From ee57ddf595851d0068730bea2ef1b55752b6d7bc Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 17 Dec 2021 11:48:25 +0100 Subject: 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. --- log-forward | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 "" ]; -- cgit v1.2.3-54-g00ecf