mirror of
https://github.com/nymurbd/MikroTik-scripts.git
synced 2025-07-09 17:44:31 +02:00
global-functions: add $GetMacVendor
This commit is contained in:
parent
2505e5d42f
commit
ee5eefefc3
4 changed files with 21 additions and 24 deletions
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue