Skip to content

Instantly share code, notes, and snippets.

@AustinW
Created June 9, 2014 02:23
Show Gist options
  • Save AustinW/0ff962f699c293666a75 to your computer and use it in GitHub Desktop.
Save AustinW/0ff962f699c293666a75 to your computer and use it in GitHub Desktop.
Change Mac address
alias generateMac="openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'"
alias currentMac="ifconfig en0 | grep ether" #b8:f6:b1:16:4d:bd
alias defaultMac="echo b8:f6:b1:16:4d:bd"
alias changeMac="sudo airport -z && sudo ifconfig en0 down && sudo ifconfig en0 up && sleep 2 && sudo ifconfig en0 ether $1"
alias newMac="sudo airport -z && changeMac $(generateMac) && currentMac"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment