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.
This commit is contained in:
Christian Hesse 2021-12-17 11:48:25 +01:00
parent b936970c19
commit ee57ddf595

View file

@ -44,7 +44,7 @@ $WaitFullyConnected;
:local Count 0; :local Count 0;
:local Duplicates false; :local Duplicates false;
:local Last [ $HexToNum $LogForwardLast ]; :local Last [ $IfThenElse ([ :len $LogForwardLast ] > 0) [ $HexToNum $LogForwardLast ] -1 ];
:local Messages ""; :local Messages "";
:local MessageVal; :local MessageVal;
:local MessageDups [ :toarray "" ]; :local MessageDups [ :toarray "" ];