diff options
author | Christian Hesse <mail@eworm.de> | 2020-02-02 15:16:36 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2020-02-02 15:16:36 +0100 |
commit | 7f8173400697e5a15cf39e21ad13612b4a1d28c5 (patch) | |
tree | 50dd278800f4d3eceabdeec24a1eeeef3d98e0e1 | |
parent | 1e72f03e5e568cec4c9850db1770e6f130446cc5 (diff) |
global-functions: $CertificateAvailable: simplify loop
-rw-r--r-- | global-functions | 8 |
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 |