diff options
author | Christian Hesse <mail@eworm.de> | 2018-12-27 00:48:56 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2018-12-27 00:48:56 +0100 |
commit | ee5eefefc3d7b256727581674f55f7d23e213a3f (patch) | |
tree | 1478d0c77fb04c77dc04d4ac2fa7e95687819ec3 /collect-wireless-mac.local | |
parent | 2505e5d42f872b5f8a4ef7e5ca42ecadb16ccdee (diff) |
global-functions: add $GetMacVendor
Diffstat (limited to 'collect-wireless-mac.local')
-rw-r--r-- | collect-wireless-mac.local | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/collect-wireless-mac.local b/collect-wireless-mac.local index 14d2781..303cb53 100644 --- a/collect-wireless-mac.local +++ b/collect-wireless-mac.local @@ -9,6 +9,7 @@ :global "identity"; :global CertificateAvailable; +:global GetMacVendor; :global SendNotification; :local "place-before" [ / interface wireless access-list find where comment="--- collected above ---" disabled ]; @@ -37,14 +38,7 @@ :local interface [ / interface wireless registration-table get $regentry interface ]; :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; |