check-certificates: make the certificate renewal time configurable

This commit is contained in:
Christian Hesse 2020-12-18 16:02:31 +01:00
parent be75772256
commit 010e2d6b05
5 changed files with 7 additions and 4 deletions

View file

@ -7,6 +7,7 @@
# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-certificates.md
:global CertRenewPass;
:global CertRenewTime;
:global CertRenewUrl;
:global Identity;
@ -28,7 +29,7 @@
$WaitFullyConnected;
:foreach Cert in=[ / certificate find where !revoked !ca !scep-url expires-after<3w ] do={
:foreach Cert in=[ / certificate find where !revoked !ca !scep-url expires-after<$CertRenewTime ] do={
:local CertVal [ / certificate get $Cert ];
:do {

View file

@ -8,7 +8,7 @@
# Make sure all configuration properties are up to date and this
# value is in sync with value in script 'global-functions'!
:global GlobalConfigVersion 39;
:global GlobalConfigVersion 40;
# This is used for DNS and backup file.
:global Domain "example.com";
@ -142,6 +142,7 @@
# Use this for certificate auto-renew
:global CertRenewUrl "";
#:global CertRenewUrl "https://example.com/certificates/";
:global CertRenewTime 3w;
:global CertRenewPass {
"v3ry-s3cr3t";
"4n0th3r-s3cr3t";

View file

@ -9,7 +9,7 @@
# Make sure all configuration properties are up to date and this
# value is in sync with value in script 'global-functions'!
# Comment or remove to disable change notifications.
:global GlobalConfigVersion 39;
:global GlobalConfigVersion 40;
# Copy configuration from global-config here and modify it.

View file

@ -48,4 +48,5 @@ $CertificateAvailable "R3";
37="Implemented simple dependency model in 'netwatch-notify'.";
38="Imported new Let's Encrypt intermediate certificate 'R3'.";
39="Added support for interface specific address list entries in 'ipv6-update'.";
40="Made the certificate renewal time configurable.";
};

View file

@ -8,7 +8,7 @@
# https://git.eworm.de/cgit/routeros-scripts/about/
# expected configuration version
:global ExpectedConfigVersion 39;
:global ExpectedConfigVersion 40;
# global variables not to be changed by user
:global GlobalFunctionsReady false;