Skip to content

Instantly share code, notes, and snippets.

@philcryer
Created January 4, 2011 05:58
Show Gist options
  • Save philcryer/764455 to your computer and use it in GitHub Desktop.
Save philcryer/764455 to your computer and use it in GitHub Desktop.
define a network card manufacturer from a given MAC address
#!/bin/bash
EXPECTED_ARGS=1
if [ $# -ne $EXPECTED_ARGS ]
then
echo "Usage: `basename $0` MAC_ADDRESS"
exit 1
fi
if [ ! -f 'oui.txt' ]; then
curl http://standards.ieee.org/develop/regauth/oui/oui.txt -o oui.txt
fi
grep `echo $1 | cut -d":" -f1,2,3 | sed 's/:/-/g'` oui.txt | cut -f3
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment