aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-11-14 22:16:33 +0100
committerGravatar Christian Hesse <mail@eworm.de>2019-11-14 22:16:33 +0100
commit845c25f87c4cfa25058f561b938c487b224af00e (patch)
tree989cbe340f193049dc958f6a1c6c0beb17f76777
parent395bc8c90f89d533486df8fd4867de4cbf6a3114 (diff)
dhcp-to-dns: act on hostname only if available
-rw-r--r--dhcp-to-dns4
1 files changed, 3 insertions, 1 deletions
diff --git a/dhcp-to-dns b/dhcp-to-dns
index 81b2964..edb50b4 100644
--- a/dhcp-to-dns
+++ b/dhcp-to-dns
@@ -49,7 +49,9 @@
:set ($LeaseVal->"address") [ / ip dhcp-server lease get ($DupMacLeases->([ :len $DupMacLeases ] - 1)) address ];
}
- :set ($LeaseVal->"address") [ / ip dhcp-server lease get ([ find where host-name=($LeaseVal->"host-name") dynamic=yes ]->0) address ];
+ :if ([ :len ($LeaseVal->"host-name") ] > 0) do={
+ :set ($LeaseVal->"address") [ / ip dhcp-server lease get ([ find where host-name=($LeaseVal->"host-name") dynamic=yes ]->0) address ];
+ }
:if ($DnsIp = $LeaseVal->"address") do={
:log debug ("DNS entry for " . $Fqdn . " does not need updating.");