Last active
June 18, 2018 05:41
-
-
Save kjellberg/50dd482f697290499f25 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
: ' | |
Change your mac address on a MacBook | |
Can be used for free wifi on airports or train stations =) | |
$ chmod +x freewifi.sh | |
$ ./freewifi.sh | |
' | |
interface=en1 # en0 for cable & en1 for wifi | |
oe=$(ifconfig $interface | grep ether) # save old ether output | |
a=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//') # generate new mac address | |
sudo ifconfig $interface ether $a # change mac address | |
ne=$(ifconfig $interface | grep ether) # get old ether output | |
if [ "$oe" != "$ne" ] # check if mac address is changed. | |
then | |
echo "Mac address changed." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mer info:
http://rasmuskjellberg.se/surfa-gratis-obegransat-pa-flygplatser-eller-andra-begransade-natverk/