Skip to content

Instantly share code, notes, and snippets.

@danielronnkvist
Created June 2, 2017 07:43
Show Gist options
  • Save danielronnkvist/42e992f6ea92661b17717577923bf882 to your computer and use it in GitHub Desktop.
Save danielronnkvist/42e992f6ea92661b17717577923bf882 to your computer and use it in GitHub Desktop.
SJ Mac changer
#!/bin/sh
# Script for quickly swicthing MAC-adress on SJ trains!
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z
sudo ifconfig en0 ether $(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')
networksetup -detectnewhardware
networksetup -setairportnetwork en0 "SJ"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment