diff options
Diffstat (limited to 'global-functions')
-rw-r--r-- | global-functions | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/global-functions b/global-functions index a7beda6..041700c 100644 --- a/global-functions +++ b/global-functions @@ -92,3 +92,18 @@ } } } + +# get MAC vendor +:global GetMacVendor do={ + :local mac [ :tostr $1 ]; + + :do { + :local vendor; + $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"); + :return $vendor; + } on-error={ + :return "unknown vendor"; + } +} |