1
0
mirror of https://github.com/eworm-de/routeros-scripts.git synced 2024-05-11 05:55:19 +00:00

check-certificates: rename all certificates by their common names

This commit is contained in:
Christian Hesse
2020-02-06 18:10:47 +01:00
parent e376845b12
commit 23fe30c4e1

View File

@ -8,6 +8,7 @@
:global CertRenewUrl;
:global CertRenewPass;
:global CertificateNameByCN;
:global ParseKeyValueStore;
:global SendNotification;
:global UrlEncode;
@ -37,6 +38,10 @@
/ certificate import file-name=$CertFileName passphrase=$PassPhrase;
}
/ file remove [ find where name=$CertFileName ];
:foreach CertInChain in=[ / certificate find where name~("^" . $CertFileName . "_[0-9]+\$") common-name!=($CertVal->"common-name") ] do={
$CertificateNameByCN [ / certificate get $CertInChain common-name ];
}
} on-error={
:log debug ("Could not download certificate file " . $CertFileName);
}