1
0
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:
Christian Hesse
2023-03-21 22:49:33 +01:00
parent 3d589def7d
commit 682a09c94b

View File

@ -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);
: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 MacAddress [ $CharacterReplace ($DnsRecordVal->"comment") $CommentPrefix "" ];
:if ([ :len [ /ip/dhcp-server/lease/find where mac-address=$MacAddress address=($DnsRecordVal->"address") status=bound ] ] > 0) do={