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.capsman | |
parent | 2505e5d42f872b5f8a4ef7e5ca42ecadb16ccdee (diff) |
global-functions: add $GetMacVendor
Diffstat (limited to 'collect-wireless-mac.capsman')
-rw-r--r-- | collect-wireless-mac.capsman | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/collect-wireless-mac.capsman b/collect-wireless-mac.capsman index 986d190..ae4da2b 100644 --- a/collect-wireless-mac.capsman +++ b/collect-wireless-mac.capsman @@ -9,6 +9,7 @@ :global "identity"; :global CertificateAvailable; +:global GetMacVendor; :global SendNotification; :local "place-before" [ / caps-man access-list find where comment="--- collected above ---" disabled ]; @@ -37,14 +38,7 @@ :local interface [ / caps-man registration-table get $regentry interface ]; :local ssid [ / caps-man registration-table get $regentry 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; |