diff options
author | Christian Hesse <mail@eworm.de> | 2022-10-19 08:50:00 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-10-19 08:54:11 +0200 |
commit | bff6689b103287f44c573e3134b9b9a64c36c0a8 (patch) | |
tree | 8e64640ef272aa583c4dfa3981d2579b110ac97d | |
parent | 621154ab83eadc612af3423dc86cad94bdc69609 (diff) |
ipsec-to-dns: strip "CN=" from peer's idrouteros-7.6-2
-rw-r--r-- | ipsec-to-dns | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ipsec-to-dns b/ipsec-to-dns index cf36987..705b5e7 100644 --- a/ipsec-to-dns +++ b/ipsec-to-dns @@ -46,8 +46,9 @@ :foreach Peer in=[ /ip/ipsec/active-peers/find where !(dynamic-address=[]) ] do={ :local PeerVal [ /ip/ipsec/active-peers/get $Peer ]; - :local Comment ($CommentPrefix . $PeerVal->"id"); - :local HostName [ :pick ($PeerVal->"id") 0 [ :find ($PeerVal->"id" . ".") "." ] ]; + :local PeerId [ $CharacterReplace ($PeerVal->"id") "CN=" "" ]; + :local Comment ($CommentPrefix . $PeerId); + :local HostName [ :pick $PeerId 0 [ :find ($PeerId . ".") "." ] ]; :local Fqdn ($HostName . "." . $Zone); :local DnsRecord [ /ip/dns/static/find where name=$Fqdn ]; |