global-functions: $CertificateDownload: use $LogPrintExit

This commit is contained in:
Christian Hesse 2020-04-03 16:45:28 +02:00
parent 7cdeb9185e
commit 596fb5f835

View file

@ -88,11 +88,12 @@
:global ScriptUpdatesUrlSuffix; :global ScriptUpdatesUrlSuffix;
:global CertificateNameByCN; :global CertificateNameByCN;
:global LogPrintExit;
:global UrlEncode; :global UrlEncode;
:global WaitForFile; :global WaitForFile;
:log info ("Downloading and importing certificate with " . \ $LogPrintExit info ("Downloading and importing certificate with " . \
"CommonName \"" . $CommonName . "\"."); "CommonName \"" . $CommonName . "\".") false;
:do { :do {
:local LocalFileName ($CommonName . ".pem"); :local LocalFileName ($CommonName . ".pem");
:local UrlFileName ([ $UrlEncode $CommonName ] . ".pem"); :local UrlFileName ([ $UrlEncode $CommonName ] . ".pem");
@ -108,7 +109,7 @@
$CertificateNameByCN [ / certificate get $Cert common-name ]; $CertificateNameByCN [ / certificate get $Cert common-name ];
} }
} on-error={ } on-error={
:log warning "Failed imprting certificate!"; $LogPrintExit warning ("Failed imprting certificate!") false;
:return false; :return false;
} }
:return true; :return true;