aboutsummaryrefslogtreecommitdiffstats
path: root/dhcp-to-dns.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-03-22 08:42:59 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-03-22 10:13:24 +0100
commit3d589def7d5a1919f41c6f6cd128ff7c383e7a3d (patch)
tree10c7c065daed81a1e54daad5bd29a7a6f9b30d38 /dhcp-to-dns.rsc
parent3396aefac9bd8c6d16112282b6f76be64deafa07 (diff)
dhcp-to-dns: allow the matching separator string in name
Diffstat (limited to 'dhcp-to-dns.rsc')
-rw-r--r--dhcp-to-dns.rsc8
1 files changed, 4 insertions, 4 deletions
diff --git a/dhcp-to-dns.rsc b/dhcp-to-dns.rsc
index 48f96b2..6e2c2a9 100644
--- a/dhcp-to-dns.rsc
+++ b/dhcp-to-dns.rsc
@@ -32,11 +32,11 @@ $ScriptLock $0 false 10;
: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 ];