diff --git a/ipsec-to-dns.rsc b/ipsec-to-dns.rsc index a81a23c..a476e74 100644 --- a/ipsec-to-dns.rsc +++ b/ipsec-to-dns.rsc @@ -33,7 +33,7 @@ } :local PlaceBefore ([ /ip/dns/static/find where (name=$CommentString or (comment=$CommentString and name=-)) type=NXDOMAIN disabled ]->0); -:foreach DnsRecord in=[ /ip/dns/static/find where comment ~ $CommentPrefix ] do={ +:foreach DnsRecord in=[ /ip/dns/static/find where comment~("^" . $CommentPrefix) ] do={ :local DnsRecordVal [ /ip/dns/static/get $DnsRecord ]; :local PeerId [ $CharacterReplace ($DnsRecordVal->"comment") $CommentPrefix "" ]; :if ([ :len [ /ip/ipsec/active-peers/find where id~("^(CN=)?" . [ $EscapeForRegEx $PeerId ] . "\$") \