diff options
author | Christian Hesse <mail@eworm.de> | 2021-07-06 22:32:42 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-07-07 00:32:50 +0200 |
commit | c982cde0bd01ed27b030ab83593cdc87c328b3d9 (patch) | |
tree | d9e73398496b64028d07597663ba82362fa0864b /collect-wireless-mac.local | |
parent | 5083ffd12f1a5eb59115b41a345f755e5a88e9e9 (diff) |
collect-wireless-mac: do not fail on missing dns record
Diffstat (limited to 'collect-wireless-mac.local')
-rw-r--r-- | collect-wireless-mac.local | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/collect-wireless-mac.local b/collect-wireless-mac.local index 41fe296..109ec5c 100644 --- a/collect-wireless-mac.local +++ b/collect-wireless-mac.local @@ -55,9 +55,10 @@ $ScriptLock $0 false 10; :if ([ :len $HostName ] = 0) do={ :set HostName "no hostname"; } - :set DnsName [ / ip dns static get ([ find where address=$Address ]->0) name ]; - :if ([ :len $DnsName ] = 0) do={ - :set DnsName "no dns name"; + :set DnsName "no dns name"; + :local DnsRec ([ / ip dns static find where address=$Address ]->0); + :if ([ :len $DnsRec ] > 0) do={ + :set DnsName [ / ip dns static get $DnsRec name ]; } } :set ($RegVal->"ssid") [ / interface wireless get [ find where name=($RegVal->"interface") ] ssid ]; |