Last active
August 7, 2024 13:32
-
-
Save lopes/4620908 to your computer and use it in GitHub Desktop.
A really simple shell script to identify your NIC's manufacturers according to its MAC addresses. #shell #shellscript #nic #mac
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
#!/bin/bash | |
#macaddr.sh | |
# | |
# It will catch all of your network interfaces and | |
# find out what's the manufacturer of each according | |
# to its OUI. | |
# | |
# José Lopes de Oliveira Jr. <indiecode.com.br> | |
# | |
# GPLv3 | |
## | |
NICS="$(ifconfig -a |grep -v "^ " \ | |
|sed -e '/^$/d; /^lo/d' \ | |
|cut -d ' ' -f1 \ | |
|tr '\n' ' ')" | |
MANU="" | |
SITE="$(curl -s http://standards.ieee.org/develop/regauth/oui/oui.txt)" | |
for nic in $NICS; do | |
MANU="$MANU $(echo "$SITE" |grep "$(ifconfig |grep HWaddr \ | |
|sed -e "s/^.*HWaddr //; s/:/-/g" \ | |
|cut -c-8)" \ | |
|cut -f3)" | |
done | |
echo -e NICs.........: $NICS | |
echo -e Manufacturers: $MANU | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment