Created
July 30, 2018 15:31
-
-
Save javahippie/6b641764755db60b7d6a2584a2a1ef4c to your computer and use it in GitHub Desktop.
Short script to change the 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/bash | |
if [ "$EUID" -ne 0 ] | |
then echo "You need to run the file as root" | |
exit | |
fi | |
WIFI_INTERFACE=en0 | |
NEW_MAC_ADDRESS=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//') | |
ifconfig $WIFI_INTERFACE ether $NEW_MAC_ADDRESS | |
echo Set MAC Address of $WIFI_INTERFACE to $NEW_MAC_ADDRESS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment