mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
collect-wireless-mac: do not fail on missing dns record
This commit is contained in:
parent
5083ffd12f
commit
c982cde0bd
3 changed files with 12 additions and 9 deletions
|
@ -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 ];
|
||||
}
|
||||
}
|
||||
:local DateTime ([ / system clock get date ] . " " . [ / system clock get time ]);
|
||||
|
|
|
@ -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 ];
|
||||
|
|
|
@ -56,9 +56,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 ];
|
||||
|
|
Loading…
Reference in a new issue