Created
May 11, 2016 06:50
-
-
Save lapnd/86461d83c13b29529aeb1184b2337736 to your computer and use it in GitHub Desktop.
Bash Random MAC Address Generator
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
function generate_mac () { | |
hexchars="0123456789abcdef" | |
echo "24:df:86$( | |
for i in {1..6}; do | |
echo -n ${hexchars:$(( $RANDOM % 16 )):1} | |
done | sed -e 's/\(..\)/:\1/g' | |
)" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment