mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-03-01 19:49:36 +00:00
global-functions: $CertificateNameByCN: support matching by fingerprint and name
This commit is contained in:
parent
89c0ad5e91
commit
c67f598dea
1 changed files with 3 additions and 2 deletions
|
|
@ -203,11 +203,12 @@
|
|||
|
||||
# name a certificate by its common-name
|
||||
:set CertificateNameByCN do={
|
||||
:local CommonName [ :tostr $1 ];
|
||||
:local Match [ :tostr $1 ];
|
||||
|
||||
:global CleanName;
|
||||
|
||||
:local Cert [ /certificate/find where common-name=$CommonName ];
|
||||
:local Cert [ /certificate/find where (common-name=$Match or fingerprint=$Match or name=$Match) ];
|
||||
:local CommonName [ /certificate/get $Cert common-name ];
|
||||
/certificate/set $Cert name=[ $CleanName $CommonName ];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue