mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
dhcp-to-dns: match comment on beginning of line
This commit is contained in:
@ -38,7 +38,7 @@ $ScriptLock $0 false 10;
|
|||||||
}
|
}
|
||||||
:local PlaceBefore ([ /ip/dns/static/find where (name=$CommentString or (comment=$CommentString and 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={
|
:foreach DnsRecord in=[ /ip/dns/static/find where comment~("^" . $CommentPrefix) ] do={
|
||||||
:local DnsRecordVal [ /ip/dns/static/get $DnsRecord ];
|
:local DnsRecordVal [ /ip/dns/static/get $DnsRecord ];
|
||||||
:local MacAddress [ $CharacterReplace ($DnsRecordVal->"comment") $CommentPrefix "" ];
|
:local MacAddress [ $CharacterReplace ($DnsRecordVal->"comment") $CommentPrefix "" ];
|
||||||
:if ([ :len [ /ip/dhcp-server/lease/find where mac-address=$MacAddress address=($DnsRecordVal->"address") status=bound ] ] > 0) do={
|
:if ([ :len [ /ip/dhcp-server/lease/find where mac-address=$MacAddress address=($DnsRecordVal->"address") status=bound ] ] > 0) do={
|
||||||
|
Reference in New Issue
Block a user