mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
global-functions: $CertificateDownload: properly name new certificates
This commit is contained in:
@ -86,6 +86,7 @@
|
|||||||
:global ScriptUpdatesBaseUrl;
|
:global ScriptUpdatesBaseUrl;
|
||||||
:global ScriptUpdatesUrlSuffix;
|
:global ScriptUpdatesUrlSuffix;
|
||||||
|
|
||||||
|
:global CharacterReplace;
|
||||||
:global UrlEncode;
|
:global UrlEncode;
|
||||||
:global WaitForFile;
|
:global WaitForFile;
|
||||||
|
|
||||||
@ -101,6 +102,10 @@
|
|||||||
$WaitForFile $LocalFileName;
|
$WaitForFile $LocalFileName;
|
||||||
/ certificate import file-name=$LocalFileName passphrase="";
|
/ certificate import file-name=$LocalFileName passphrase="";
|
||||||
/ file remove $LocalFileName;
|
/ 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={
|
} on-error={
|
||||||
:log warning "Failed imprting certificate!";
|
:log warning "Failed imprting certificate!";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user