mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-01 08:44:32 +02:00
global-functions: $CertificateNameByCN: support matching by fingerprint and name
This commit is contained in:
parent
019e10e190
commit
e36613608c
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