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.template | |
parent | 2505e5d42f872b5f8a4ef7e5ca42ecadb16ccdee (diff) |
global-functions: add $GetMacVendor
Diffstat (limited to 'collect-wireless-mac.template')
-rw-r--r-- | collect-wireless-mac.template | 10 |
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; |