diff options
author | Christian Hesse <mail@eworm.de> | 2021-06-30 13:49:03 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-07-01 22:52:38 +0200 |
commit | 5f357fd242c8798769e505817bb075eb9abf8a88 (patch) | |
tree | 35285df91ac63fbc5fc169c0082b9956969555c5 /dhcp-to-dns | |
parent | 23daea2354172bb7235f91393b73c401f8188829 (diff) |
dhcp-to-dns: fix static lease that lost bound status
Diffstat (limited to 'dhcp-to-dns')
-rw-r--r-- | dhcp-to-dns | 5 |
1 files changed, 4 insertions, 1 deletions
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={ |