mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
dhcp-to-dns: warn on duplicate names
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
:global EitherOr;
|
:global EitherOr;
|
||||||
:global IfThenElse;
|
:global IfThenElse;
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
|
:global LogPrintOnce;
|
||||||
:global ParseKeyValueStore;
|
:global ParseKeyValueStore;
|
||||||
:global ScriptLock;
|
: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;
|
/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={
|
} else={
|
||||||
$LogPrintExit2 debug $0 ("No address available... Ignoring.") false;
|
$LogPrintExit2 debug $0 ("No address available... Ignoring.") false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user