diff options
author | Christian Hesse <mail@eworm.de> | 2023-10-27 09:08:23 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-10-27 14:13:58 +0200 |
commit | c34599fe46f91f83aac8bce78f3e250a0a46f60e (patch) | |
tree | ac931346d686178df7a2274f89147848d3b4b07e /dhcp-to-dns.rsc | |
parent | 3474b9a15c75ba4bb0af438362cd096be848da91 (diff) |
dhcp-to-dns: warn on duplicate names
Diffstat (limited to 'dhcp-to-dns.rsc')
-rw-r--r-- | dhcp-to-dns.rsc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/dhcp-to-dns.rsc b/dhcp-to-dns.rsc index e7620fa..5bd4462 100644 --- a/dhcp-to-dns.rsc +++ b/dhcp-to-dns.rsc @@ -19,6 +19,7 @@ :global EitherOr; :global IfThenElse; :global LogPrintExit2; +:global LogPrintOnce; :global ParseKeyValueStore; :global ScriptLock; @@ -108,6 +109,10 @@ $ScriptLock $0 false 10; /ip/dns/static/add name=($HostName . "." . $NetDomain) type=CNAME cname=($MacDash . "." . $NetDomain) ttl=$Ttl comment=$Comment place-before=$PlaceBefore; } } + + :if ([ :len [ /ip/dns/static/find where name=($MacDash . "." . $NetDomain) (!type or type=A) ] ] > 1) do={ + $LogPrintOnce warning $0 ("The name '" . $MacDash . "." . $NetDomain . "' appeared in more than one A record!"); + } } else={ $LogPrintExit2 debug $0 ("No address available... Ignoring.") false; } |