From 5f357fd242c8798769e505817bb075eb9abf8a88 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 30 Jun 2021 13:49:03 +0200 Subject: dhcp-to-dns: fix static lease that lost bound status --- dhcp-to-dns | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dhcp-to-dns b/dhcp-to-dns index a7a05ad..1dc3b42 100644 --- a/dhcp-to-dns +++ b/dhcp-to-dns @@ -76,7 +76,10 @@ $ScriptLock $0 false 10; } :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={ -- cgit v1.2.3-54-g00ecf