mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 10:04:19 +02:00
dhcp-to-dns: warn on duplicate names
This commit is contained in:
parent
3474b9a15c
commit
c34599fe46
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue