mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-03 06:34:27 +02:00
check-certificates: try to fetch PEM and P12 file
This commit is contained in:
parent
5beebbe8e8
commit
e562825bd9
1 changed files with 10 additions and 4 deletions
|
@ -34,11 +34,17 @@
|
|||
:error "No CertRenewUrl given.";
|
||||
}
|
||||
|
||||
/ tool fetch check-certificate=yes-without-crl ($CertRenewUrl . $CommonName . ".pem");
|
||||
:foreach PassPhrase in=$CertRenewPass do={
|
||||
/ certificate import file-name=($CommonName . ".pem") passphrase=$PassPhrase;
|
||||
:foreach Type in={ ".pem"; ".p12" } do={
|
||||
:do {
|
||||
/ tool fetch check-certificate=yes-without-crl ($CertRenewUrl . $CommonName . $Type);
|
||||
:foreach PassPhrase in=$CertRenewPass do={
|
||||
/ certificate import file-name=($CommonName . $Type) passphrase=$PassPhrase;
|
||||
}
|
||||
/ file remove [ find where name=($CommonName . $Type) ];
|
||||
} on-error={
|
||||
:log debug ("Could not download certificate file " . $CommonName . $Type);
|
||||
}
|
||||
}
|
||||
/ file remove [ find where name=($CommonName . ".pem") ];
|
||||
|
||||
:local CertNew [ / certificate find where common-name=$CommonName fingerprint!=$FingerPrint expires-after>3w ];
|
||||
:local CertNameNew [ / certificate get $CertNew name ];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue