mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-03 01:35:03 +02:00
check-certificates: do not rename the wrong certificate
This commit is contained in:
parent
44d0c852f1
commit
75e5ddec52
1 changed files with 4 additions and 2 deletions
|
@ -68,8 +68,10 @@
|
|||
$LogPrint warning $ScriptName ("Decryption failed for certificate file '" . $CertFileName . "'.");
|
||||
}
|
||||
|
||||
:foreach CertInChain in=[ /certificate/find where name~("^" . [ $EscapeForRegEx $CertFileName ] . "_[0-9]+\$") \
|
||||
common-name!=$Name !(subject-alt-name~("(^|\\W)(DNS|IP):" . [ $EscapeForRegEx $Name ] . "(\\W|\$)")) !(common-name=[]) ] do={
|
||||
:foreach CertInChain in=[ /certificate/find where common-name!=$Name !private-key \
|
||||
name~("^" . [ $EscapeForRegEx $CertFileName ] . "_[0-9]+\$") \
|
||||
!(subject-alt-name~("(^|\\W)(DNS|IP):" . [ $EscapeForRegEx $Name ] . "(\\W|\$)")) \
|
||||
!(common-name=[]) ] do={
|
||||
$CertificateNameByCN [ /certificate/get $CertInChain common-name ];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue