aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-02-02 15:16:36 +0100
committerGravatar Christian Hesse <mail@eworm.de>2020-02-02 15:16:36 +0100
commit7f8173400697e5a15cf39e21ad13612b4a1d28c5 (patch)
tree50dd278800f4d3eceabdeec24a1eeeef3d98e0e1 /global-functions
parent1e72f03e5e568cec4c9850db1770e6f130446cc5 (diff)
global-functions: $CertificateAvailable: simplify loop
Diffstat (limited to 'global-functions')
-rw-r--r--global-functions8
1 files changed, 4 insertions, 4 deletions
diff --git a/global-functions b/global-functions
index 796bd0e..05b5093 100644
--- a/global-functions
+++ b/global-functions
@@ -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