Skip to content

Instantly share code, notes, and snippets.

@ahhh
Forked from kevinwallace/SpoofMAC
Last active August 29, 2015 14:21
Show Gist options
  • Save ahhh/3735257875f20b8d25ab to your computer and use it in GitHub Desktop.
Save ahhh/3735257875f20b8d25ab to your computer and use it in GitHub Desktop.
#!/bin/sh
. /etc/rc.common
StartService ()
{
ConsoleMessage "Running SpoofMAC script."
/usr/sbin/networksetup -setairportpower en0 on
/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z
/sbin/ifconfig en0 ether `python -c 'import random;print ":".join("%02x" % octet for octet in [random.randint(0,64) << 2] + [random.randint(0,127) for _ in range(5)])'`
/usr/sbin/networksetup -detectnewhardware
}
StopService ()
{
return 0
}
RestartService ()
{
return 0
}
RunService "$1"
{
Description = "SpoofMAC";
Provides = ("SpoofMAC");
Requires = ("Network", "Disks");
OrderPreference = "None";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment