From 209759124449a1ab522883e1c2e4c44e76d91ac3 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..f3bf33c 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") ] - 3w > [ :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...");