aboutsummaryrefslogtreecommitdiffstats
path: root/dhcp-to-dns
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-06-30 13:49:03 +0200
committerGravatar Christian Hesse <mail@eworm.de>2021-07-01 22:52:38 +0200
commit5f357fd242c8798769e505817bb075eb9abf8a88 (patch)
tree35285df91ac63fbc5fc169c0082b9956969555c5 /dhcp-to-dns
parent23daea2354172bb7235f91393b73c401f8188829 (diff)
dhcp-to-dns: fix static lease that lost bound status
Diffstat (limited to 'dhcp-to-dns')
-rw-r--r--dhcp-to-dns5
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={