dhcp-to-dns: fix static lease that lost bound status

This commit is contained in:
Christian Hesse 2021-06-30 13:49:03 +02:00
parent 23daea2354
commit 5f357fd242

View file

@ -76,7 +76,10 @@ $ScriptLock $0 false 10;
} }
:if ([ :len ($LeaseVal->"host-name") ] > 0) do={ :if ([ :len ($LeaseVal->"host-name") ] > 0) do={
:set ($LeaseVal->"address") [ / ip dhcp-server lease get ([ find where host-name=($LeaseVal->"host-name") status=bound ]->0) address ]; :local HostNameLeases [ / ip dhcp-server lease find where host-name=($LeaseVal->"host-name") status=bound ];
:if ([ :len $HostNameLeases ] > 1) do={
:set ($LeaseVal->"address") [ / ip dhcp-server lease get ($HostNameLeases->0) address ];
}
} }
:if ($DnsIp = $LeaseVal->"address") do={ :if ($DnsIp = $LeaseVal->"address") do={