aboutsummaryrefslogtreecommitdiffstats
path: root/collect-wireless-mac.local.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-09-20 12:26:49 +0200
committerGravatar Christian Hesse <mail@eworm.de>2023-09-20 12:26:49 +0200
commit57c5c3f7049c0d60340c7fa66cb85cc2d5b65e78 (patch)
treedf0bf812419b2ff88f04c0913527fee71c4aab02 /collect-wireless-mac.local.rsc
parent4ddc6be5859210e6a4c47699884f3fb67c3ed777 (diff)
collect-wireless-mac: add CNAME(s) in notification
Diffstat (limited to 'collect-wireless-mac.local.rsc')
-rw-r--r--collect-wireless-mac.local.rsc8
1 files changed, 6 insertions, 2 deletions
diff --git a/collect-wireless-mac.local.rsc b/collect-wireless-mac.local.rsc
index 6bc8f45..99f8d3b 100644
--- a/collect-wireless-mac.local.rsc
+++ b/collect-wireless-mac.local.rsc
@@ -18,6 +18,7 @@
:global EitherOr;
:global FormatLine;
+:global FormatMultiLines;
:global GetMacVendor;
:global LogPrintExit2;
:global ScriptLock;
@@ -58,7 +59,10 @@ $ScriptLock $0 false 10;
: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 DnsName ({ [ /ip/dns/static/get $DnsRec name ] });
+ :foreach CName in=[ /ip/dns/static/find where cname=($DnsName->0) ] do={
+ :set DnsName ($DnsName, [ /ip/dns/static/get $CName name ]);
+ }
}
}
:set ($RegVal->"ssid") [ /interface/wireless/get [ find where name=($RegVal->"interface") ] ssid ];
@@ -78,7 +82,7 @@ $ScriptLock $0 false 10;
[ $FormatLine "Vendor" $Vendor ] . "\n" . \
[ $FormatLine "Hostname" $HostName ] . "\n" . \
[ $FormatLine "Address" $Address ] . "\n" . \
- [ $FormatLine "DNS name" $DnsName ] . "\n" . \
+ [ $FormatMultiLines "DNS name" $DnsName ] . "\n" . \
[ $FormatLine "Date" $DateTime ]) });
}
} else={