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:
@ -8,6 +8,7 @@
|
|||||||
:global CertRenewUrl;
|
:global CertRenewUrl;
|
||||||
:global CertRenewPass;
|
:global CertRenewPass;
|
||||||
|
|
||||||
|
:global CertificateNameByCN;
|
||||||
:global ParseKeyValueStore;
|
:global ParseKeyValueStore;
|
||||||
:global SendNotification;
|
:global SendNotification;
|
||||||
:global UrlEncode;
|
:global UrlEncode;
|
||||||
@ -37,6 +38,10 @@
|
|||||||
/ certificate import file-name=$CertFileName passphrase=$PassPhrase;
|
/ certificate import file-name=$CertFileName passphrase=$PassPhrase;
|
||||||
}
|
}
|
||||||
/ file remove [ find where name=$CertFileName ];
|
/ 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={
|
} on-error={
|
||||||
:log debug ("Could not download certificate file " . $CertFileName);
|
:log debug ("Could not download certificate file " . $CertFileName);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user