From b3a76c7e4b5e32be9fcffdeeecfa8c61f365de22 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 6 Jan 2020 10:20:19 +0100 Subject: global-functions: $CertificateDownload: properly name new certificates --- global-functions | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/global-functions b/global-functions index 611241f..f510218 100644 --- a/global-functions +++ b/global-functions @@ -86,6 +86,7 @@ :global ScriptUpdatesBaseUrl; :global ScriptUpdatesUrlSuffix; + :global CharacterReplace; :global UrlEncode; :global WaitForFile; @@ -101,6 +102,10 @@ $WaitForFile $LocalFileName; / certificate import file-name=$LocalFileName passphrase=""; / file remove $LocalFileName; + + :foreach Cert in=[ / certificate find where name~("^" . $LocalFileName . "_[0-9]+\$") ] do={ + / certificate set $Cert name=[ $CharacterReplace [ $CharacterReplace [ get $Cert common-name ] " " "-" ] "---" "-" ]; + } } on-error={ :log warning "Failed imprting certificate!"; } -- cgit v1.2.3-54-g00ecf