mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
dhcp-to-dns: use better condition
The condition worked, but could match others (AAAA, NXDOMAIN, ...) as well (though these should not exist). The problem is that matching with `type=A` does not return any results. For historical reasons A records have no type, thus can be matched with `!type`. I opened an issue to fix this... (SUP-111312) So let's assum `!type` works and `type=A` could become valid...
This commit is contained in:
parent
3d0107ed2c
commit
779b3b8872
1 changed files with 1 additions and 1 deletions
|
@ -40,7 +40,7 @@ $ScriptLock $0 false 10;
|
|||
}
|
||||
: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) !(type=CNAME) ] do={
|
||||
:foreach DnsRecord in=[ /ip/dns/static/find where comment~("^" . $CommentPrefix) (!type or type=A) ] do={
|
||||
:local DnsRecordVal [ /ip/dns/static/get $DnsRecord ];
|
||||
:local MacAddress [ $CharacterReplace ($DnsRecordVal->"comment") $CommentPrefix "" ];
|
||||
:if ([ :len [ /ip/dhcp-server/lease/find where mac-address=$MacAddress address=($DnsRecordVal->"address") status=bound ] ] > 0) do={
|
||||
|
|
Loading…
Reference in a new issue