-#!rsc by RouterOS
-# RouterOS script: check-certificates
-# Copyright (c) 2013-2026 Christian Hesse <mail@eworm.de>
-# https://rsc.eworm.de/COPYING.md
+#!rsc by Vados
+# RouterOS script: AM-CheckCerts
+# Script comment: Check for certificates validity
+# Copyright (c) 2005-2026 Vados <vados@vados.ru>
+#
#
# requires RouterOS, version=7.19
# requires device-mode, fetch
#
-# check for certificate validity
-# https://rsc.eworm.de/doc/check-certificates.md
:local ExitOK false;
:onerror Err {
:global EscapeForRegEx;
:global IfThenElse;
:global LogPrint;
- :global LogPrintOnce;
:global ParseKeyValueStore;
:global ScriptLock;
:global SendNotification2;
:global SymbolForNotification;
:global UrlEncode;
- :global WaitFullyConnected;
+# :global WaitFullyConnected;
:local CheckCertificatesDownloadImport do={
:local ScriptName [ :tostr $1 ];
:set ExitOK true;
:error false;
}
- $WaitFullyConnected;
+# $WaitFullyConnected;
:foreach Cert in=[ /certificate/find where !revoked !ca !scep-url expires-after<$CertRenewTime ] do={
:local CertVal [ /certificate/get $Cert ];
:do {
:if ([ :len $CertRenewUrl ] = 0) do={
- $LogPrintOnce info $ScriptName ("No CertRenewUrl given.");
+ $LogPrint info $ScriptName ("No CertRenewUrl given.");
:error false;
}
$LogPrint info $ScriptName ("Attempting to renew certificate '" . ($CertVal->"name") . "'.");
:global GlobalFuncReady false;
# Git commit id & info, expected configuration version
-:global CommitId "main/203/0fd482ff";
+:global CommitId "main/204/e3bdf105";
:global CommitTAG "unknown";
-:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 05:25:02 01.04.2026.";
+:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 05:30:03 01.04.2026.";
# The variables are received right here.
:global GlobalConfVersion 138;