diff options
author | Christian Hesse <mail@eworm.de> | 2020-01-06 10:20:19 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2020-01-06 10:20:19 +0100 |
commit | b3a76c7e4b5e32be9fcffdeeecfa8c61f365de22 (patch) | |
tree | 43f8daa3a854394910f1416feb547187ac5a4f8f | |
parent | aa885e17e2b929500d5992b396e9460e325036be (diff) |
global-functions: $CertificateDownload: properly name new certificates
-rw-r--r-- | global-functions | 5 |
1 files changed, 5 insertions, 0 deletions
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!"; } |