Last active
October 30, 2016 01:15
-
-
Save chabala/e85128517ca628a8c4ca to your computer and use it in GitHub Desktop.
Lookup hardware manufacturers by MAC address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Lookup MAC address owners via http://standards.ieee.org/develop/regauth/oui/public.html | |
# parameter is in triple octet form, e.g. CC-6D-A0 | |
set -o errexit | |
set -o nounset | |
mac=${1//:/-} | |
url="https://services13.ieee.org/RST/standards-ra-web/rest/assignments/download/?registry=MA-L&format=html&text=$mac" | |
if command -v lynx >/dev/null 2>&1; then | |
#if you have lynx installed | |
curl --silent --fail --show-error "$url" | lynx -stdin -dump -nolist | |
else | |
curl --silent --fail --show-error "$url" | |
fi | |
exit $? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment