Created
October 9, 2015 20:24
-
-
Save travis-g/ad76f9b0fb9ce1a0b728 to your computer and use it in GitHub Desktop.
MAC randomizer script
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 | |
usage() { | |
cat<<EOF | |
usage: $(basename $0) [-h] dev | |
Useful for getting around timed public WiFi sessions. Your wireless device may | |
need to be restarted after running for the changes to apply. | |
EOF | |
} | |
test "$1" = '-h' && usage && exit 0 | |
DEFAULT_DEV=eth0 | |
DEFAULT_ADDR=ether | |
dev=${1:-$DEFAULT_DEV} | |
addr=${2:-$DEFAULT_ADDR} | |
openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//' | xargs sudo ifconfig $dev $addr || exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment