Created
February 23, 2017 01:55
-
-
Save okeuday/c7cbb8e8be2bba2068593ed4aa3be831 to your computer and use it in GitHub Desktop.
Automatically generate a valid 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
#!/bin/sh | |
# wget http://standards.ieee.org/develop/regauth/oui/oui.txt | |
DIRECTORY=`dirname $0` | |
PREFIX=`shuf $DIRECTORY/oui.txt | grep '(base 16)' | head -n 1 | cut -c '3-8'` | |
SUFFIX=`openssl rand -hex 3 | sed 's/.*/\U&/'` | |
echo "$PREFIX$SUFFIX" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment