Created
June 14, 2013 22:14
-
-
Save Flushot/5785697 to your computer and use it in GitHub Desktop.
Shell script to change MAC address on OSX
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 | |
IFACE=en0 | |
macaddr=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'` | |
sudo airport -z | |
osascript -e 'tell application "System Preferences" to quit' | |
sudo scselect -n | |
sudo ifconfig $IFACE lladdr $macaddr | |
# These should match | |
echo $macaddr | |
ifconfig $IFACE | grep ether |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment