aboutsummaryrefslogtreecommitdiffstats
path: root/ipsec-to-dns
diff options
context:
space:
mode:
Diffstat (limited to 'ipsec-to-dns')
-rw-r--r--ipsec-to-dns5
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 ];