mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-16 04:54:28 +02:00
global-functions: $CertificateDownload: properly name new certificates
This commit is contained in:
parent
aa885e17e2
commit
b3a76c7e4b
1 changed files with 5 additions and 0 deletions
|
@ -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!";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue