check-routeros-update: send notification on renewed license...

... when a warning has been sent before.
This commit is contained in:
Christian Hesse 2025-03-24 21:14:12 +01:00
parent 6909514692
commit 16c9ce437e

View file

@ -92,6 +92,16 @@
:set SentCertificateNotification "warning";
}
}
:if ([ :typeof $SentCertificateNotification ] = "str" && \
[ :totime ($License->"deadline-at") ] - 4w > [ :timestamp ]) do={
$LogPrint info $ScriptName ("Your license was successfully renewed.");
$SendNotification2 ({ origin=$ScriptName; \
subject=([ $SymbolForNotification "white-heavy-check-mark" ] . "License renewed"); \
message=("Your license was successfully renewed on " . $Identity . \
". It is now valid until " . ($License->"deadline-at") . ".") });
:set SentCertificateNotification;
}
}
$LogPrint debug $ScriptName ("Checking for updates...");