diff options
author | Christian Hesse <mail@eworm.de> | 2019-11-25 16:43:19 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2019-11-25 16:43:19 +0100 |
commit | 15a6fb325ee25d48c585d2a9c29763ae2c516f39 (patch) | |
tree | f05e2c56baf0979cf0c61ee45326a425679816c1 /collect-wireless-mac.template | |
parent | b70d4f7666e4a2ad7c447b84c9faa1f42374158a (diff) |
collect-wireless-mac: lease without address should be impossible...
... we need the check for empty hostname, though.
Diffstat (limited to 'collect-wireless-mac.template')
-rw-r--r-- | collect-wireless-mac.template | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/collect-wireless-mac.template b/collect-wireless-mac.template index eba06ad..c7a2e54 100644 --- a/collect-wireless-mac.template +++ b/collect-wireless-mac.template @@ -25,18 +25,15 @@ $ScriptLock "collect-wireless-mac%TEMPL%"; :local Mac [ / %PATH% registration-table get $RegTbl mac-address ]; :local AccessList ([ / %PATH% access-list find where mac-address=$Mac ]->0); :if ([ :len $AccessList ] = 0) do={ - :local HostName "no dhcp lease"; :local Address "no dhcp lease"; + :local HostName "no dhcp lease"; :local Lease [ / ip dhcp-server lease find where mac-address=$Mac ]; :if ([ :len $Lease ] > 0) do={ - :set HostName [ / ip dhcp-server lease get $Lease host-name ]; :set Address [ / ip dhcp-server lease get $Lease address ]; + :set HostName [ / ip dhcp-server lease get $Lease host-name ]; :if ([ :len $HostName ] = 0) do={ :set HostName "no hostname"; } - :if ([ :len $Address ] = 0) do={ - :set Address "no address"; - } } :local RegEntry [ / %PATH% registration-table find where mac-address=$Mac ]; :local Interface [ / %PATH% registration-table get $RegEntry interface ]; |