aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-03-22 08:58:20 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-03-22 08:58:51 +0100
commit6e8c98e43d6f69882a3472416a1c2d08672aa9fa (patch)
treee2828aef3fb6a6639192f78e7fd3e1a396852cf5
parent524c1fc032db7e4c361b90fe912fef036f1f59e2 (diff)
ipsec-to-dns: allow the matching separator string in name
-rw-r--r--ipsec-to-dns.rsc8
1 files changed, 4 insertions, 4 deletions
diff --git a/ipsec-to-dns.rsc b/ipsec-to-dns.rsc
index 530c714..a81a23c 100644
--- a/ipsec-to-dns.rsc
+++ b/ipsec-to-dns.rsc
@@ -27,11 +27,11 @@
:local CommentPrefix ("managed by " . $0 . " for ");
:local CommentString ("--- " . $0 . " above ---");
-:if ([ :len [ /ip/dns/static/find where comment=$CommentString name=- type=NXDOMAIN disabled ] ] = 0) do={
- /ip/dns/static/add comment=$CommentString name=- type=NXDOMAIN disabled=yes;
- $LogPrintExit2 warning $0 ("Added disabled static dns record with comment '" . $CommentString . "'.") false;
+:if ([ :len [ /ip/dns/static/find where (name=$CommentString or (comment=$CommentString and name=-)) type=NXDOMAIN disabled ] ] = 0) do={
+ /ip/dns/static/add name=$CommentString type=NXDOMAIN disabled=yes;
+ $LogPrintExit2 warning $0 ("Added disabled static dns record with name '" . $CommentString . "'.") false;
}
-:local PlaceBefore ([ /ip/dns/static/find where comment=$CommentString name=- type=NXDOMAIN disabled ]->0);
+: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={
:local DnsRecordVal [ /ip/dns/static/get $DnsRecord ];