From b70d4f7666e4a2ad7c447b84c9faa1f42374158a Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 25 Nov 2019 16:39:23 +0100 Subject: collect-wireless-mac: move code into condition --- collect-wireless-mac.capsman | 12 ++++++------ collect-wireless-mac.local | 12 ++++++------ collect-wireless-mac.template | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/collect-wireless-mac.capsman b/collect-wireless-mac.capsman index dd27ba6..1aa5cb7 100644 --- a/collect-wireless-mac.capsman +++ b/collect-wireless-mac.capsman @@ -30,12 +30,12 @@ $ScriptLock "collect-wireless-mac.capsman"; :if ([ :len $Lease ] > 0) do={ :set HostName [ / ip dhcp-server lease get $Lease host-name ]; :set Address [ / ip dhcp-server lease get $Lease address ]; - } - :if ([ :len $HostName ] = 0) do={ - :set HostName "no hostname"; - } - :if ([ :len $Address ] = 0) do={ - :set Address "no address"; + :if ([ :len $HostName ] = 0) do={ + :set HostName "no hostname"; + } + :if ([ :len $Address ] = 0) do={ + :set Address "no address"; + } } :local RegEntry [ / caps-man registration-table find where mac-address=$Mac ]; :local Interface [ / caps-man registration-table get $RegEntry interface ]; diff --git a/collect-wireless-mac.local b/collect-wireless-mac.local index a28e2ee..882741f 100644 --- a/collect-wireless-mac.local +++ b/collect-wireless-mac.local @@ -30,12 +30,12 @@ $ScriptLock "collect-wireless-mac.local"; :if ([ :len $Lease ] > 0) do={ :set HostName [ / ip dhcp-server lease get $Lease host-name ]; :set Address [ / ip dhcp-server lease get $Lease address ]; - } - :if ([ :len $HostName ] = 0) do={ - :set HostName "no hostname"; - } - :if ([ :len $Address ] = 0) do={ - :set Address "no address"; + :if ([ :len $HostName ] = 0) do={ + :set HostName "no hostname"; + } + :if ([ :len $Address ] = 0) do={ + :set Address "no address"; + } } :local RegEntry [ / interface wireless registration-table find where mac-address=$Mac ]; :local Interface [ / interface wireless registration-table get $RegEntry interface ]; diff --git a/collect-wireless-mac.template b/collect-wireless-mac.template index 9e06a88..eba06ad 100644 --- a/collect-wireless-mac.template +++ b/collect-wireless-mac.template @@ -31,12 +31,12 @@ $ScriptLock "collect-wireless-mac%TEMPL%"; :if ([ :len $Lease ] > 0) do={ :set HostName [ / ip dhcp-server lease get $Lease host-name ]; :set Address [ / ip dhcp-server lease get $Lease address ]; - } - :if ([ :len $HostName ] = 0) do={ - :set HostName "no hostname"; - } - :if ([ :len $Address ] = 0) do={ - :set Address "no address"; + :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 ]; -- cgit v1.2.3-70-g09d2