mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
global-functions: $CertificateAvailable: simplify loop
This commit is contained in:
parent
1e72f03e5e
commit
7f81734006
|
@ -130,16 +130,16 @@
|
|||
$CertificateDownload $CommonName;
|
||||
}
|
||||
|
||||
:local CertVal [ / certificate get [ find where common-name=$CommonName ] ];
|
||||
:local Issuer ([ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN");
|
||||
:while ($Issuer != $CertVal->"common-name") do={
|
||||
:local CertVal;
|
||||
:local Issuer $CommonName;
|
||||
:do {
|
||||
:if ([ / certificate print count-only where common-name=$Issuer ] = 0) do={
|
||||
:log info ("Certificate chain for \"" . $CommonName . "\" is incomplete, missing \"" . $Issuer . "\".");
|
||||
$CertificateDownload $CommonName;
|
||||
}
|
||||
:set CertVal [ / certificate get [ find where common-name=$Issuer ] ];
|
||||
:set Issuer ([ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN");
|
||||
}
|
||||
} while=($Issuer != $CertVal->"common-name");
|
||||
}
|
||||
|
||||
# send notification via e-mail
|
||||
|
|
Loading…
Reference in a new issue