mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
check-certificates: rename all certificates by their common names
This commit is contained in:
parent
e376845b12
commit
23fe30c4e1
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue