From 16c9ce437ef268780303f627bba08a166e2aef05 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 24 Mar 2025 21:14:12 +0100 Subject: [PATCH] check-routeros-update: send notification on renewed license... ... when a warning has been sent before. --- check-routeros-update.rsc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/check-routeros-update.rsc b/check-routeros-update.rsc index 51df175..1a5a930 100644 --- a/check-routeros-update.rsc +++ b/check-routeros-update.rsc @@ -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...");