aboutsummaryrefslogtreecommitdiffstats
path: root/collect-wireless-mac.template
diff options
context:
space:
mode:
Diffstat (limited to 'collect-wireless-mac.template')
-rw-r--r--collect-wireless-mac.template10
1 files changed, 2 insertions, 8 deletions
diff --git a/collect-wireless-mac.template b/collect-wireless-mac.template
index 274f639..fc4b3fb 100644
--- a/collect-wireless-mac.template
+++ b/collect-wireless-mac.template
@@ -10,6 +10,7 @@
:global "identity";
:global CertificateAvailable;
+:global GetMacVendor;
:global SendNotification;
:local "place-before" [ / %PATH% access-list find where comment="--- collected above ---" disabled ];
@@ -39,14 +40,7 @@
:local ssid [ / caps-man registration-table get $regentry ssid ];
:local ssid [ / interface wireless get [ find where name=$interface ] ssid ];
:local datetime ([ / system clock get date ] . " " . [ / system clock get time ]);
- :local vendor;
- :do {
- $CertificateAvailable "Let's Encrypt Authority X3" "letsencrypt";
- :set vendor ([ / tool fetch mode=https check-certificate=yes-without-crl \
- url=("https://api.macvendors.com/" . [ :pick $mac 0 8 ]) output=user as-value ]->"data");
- } on-error={
- :set vendor "unknown vendor";
- }
+ :local vendor [ $GetMacVendor $mac ];
:local message ("unknown MAC address " . $mac . " (" . $vendor . ", " . $hostname . ") " . \
"first seen on " . $datetime . " connected to SSID " . $ssid . ", interface " . $interface);
/ log info $message;