diff options
author | Christian Hesse <mail@eworm.de> | 2019-11-14 22:16:33 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2019-11-14 22:16:33 +0100 |
commit | 845c25f87c4cfa25058f561b938c487b224af00e (patch) | |
tree | 989cbe340f193049dc958f6a1c6c0beb17f76777 | |
parent | 395bc8c90f89d533486df8fd4867de4cbf6a3114 (diff) |
dhcp-to-dns: act on hostname only if available
-rw-r--r-- | dhcp-to-dns | 4 |
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."); |