feross / SpoofMAC

:briefcase: Change your MAC address for debugging
https://feross.org/spoofmac/
3.02k stars 271 forks source link

Automatically reconnect to last connected network? #50

Closed hubdotcom closed 8 years ago

hubdotcom commented 9 years ago

This would be fantastic if it was possible!

raincoats commented 9 years ago

Interesting question! I'm not really 100% on github etiquette, but I just tried it out and I think it's probably ok to share, even though this isn't my project.

on OS X this seems to work (but it really seems like it would break easily):

wifi=$(networksetup -getairportnetwork en0 | sed 's/.*: //')
sudo spoof-mac.py randomize en0
networksetup -setairportnetwork en0 $wifi
feross commented 9 years ago

@raincoats Cool trick! Can someone send a pull request and add this feature? Thanks!