From 172298f5eb2e9131ad5c2157d2d8e0c7f520e9eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Witkowski?= Date: Mon, 11 May 2026 17:17:35 +0200 Subject: [PATCH] dhcp-to-dns: set $LeaseInfo --- dhcp-to-dns.rsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dhcp-to-dns.rsc b/dhcp-to-dns.rsc index d93eeb34..007a96e3 100644 --- a/dhcp-to-dns.rsc +++ b/dhcp-to-dns.rsc @@ -66,6 +66,7 @@ $LogPrint debug $ScriptName ("A lease just vanished, ignoring."); :continue; } + :local LeaseInfo [ $ParseKeyValueStore ($LeaseVal->"comment") ]; :if ([ :len ($LeaseVal->"active-address") ] = 0) do={ $LogPrint debug $ScriptName ("No address available... Ignoring."); @@ -86,7 +87,7 @@ :local Comment ($CommentPrefix . ", macaddress=" . $LeaseVal->"active-mac-address" . ", server=" . $LeaseVal->"server"); :local MacDash [ $CleanName ($LeaseVal->"active-mac-address") ]; - :local HostName [ $CleanName [ $EitherOr ([ $ParseKeyValueStore ($LeaseVal->"comment") ]->"hostname") ($LeaseVal->"host-name") ] ]; + :local HostName [ $CleanName [ $EitherOr ($LeaseInfo->"hostname") ($LeaseVal->"host-name") ] ]; :local NetDomain ([ $IfThenElse ([ :len ($NetworkInfo->"name-extra") ] > 0) ($NetworkInfo->"name-extra" . ".") ] . \ [ $EitherOr [ $EitherOr ($NetworkInfo->"domain") ($NetworkVal->"domain") ] $Domain ]); :local FullA [ :convert transform=lc ($MacDash . "." . $NetDomain) ];