Created
May 23, 2014 07:25
-
-
Save pgrm/82fc72f6a41578e0b0c9 to your computer and use it in GitHub Desktop.
I'm having troubles with my internet connection and need to connect to my router with a different mac address every time. This script creates a random mac address and tries to set it, when the two mac-addresses displayed by this script are the same, it was set successfully.
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
macAddress=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'` | |
sudo ifconfig en0 ether $macAddress | |
echo "new mac address:" | |
echo $macAddress | |
sudo ifconfig en0 ether |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment