check-certificates: simplify return from function...

... and also break earch on success.
This commit is contained in:
Christian Hesse 2025-02-26 13:51:25 +01:00
parent 512c54bd59
commit e833dfcf25

View file

@ -48,8 +48,6 @@
:global UrlEncode;
:global WaitForFile;
:local Return false;
:foreach Type in={ "pem"; "p12" } do={
:local CertFileName ([ $UrlEncode $FetchName ] . "." . $Type);
$LogPrint debug $ScriptName ("Trying type '" . $Type . "' for '" . $CertName . \
@ -84,13 +82,13 @@
$CertificateNameByCN [ /certificate/get $CertInChain common-name ];
}
:set Return true;
:return true;
} on-error={
$LogPrint debug $ScriptName ("Could not download certificate file '" . $CertFileName . "'.");
}
}
:return $Return;
:return false;
}
:local FormatInfo do={