Skip to content

Instantly share code, notes, and snippets.

@endreszabo
Created December 15, 2011 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save endreszabo/1479211 to your computer and use it in GitHub Desktop.
Save endreszabo/1479211 to your computer and use it in GitHub Desktop.
changes mac for fun and profit
#!/bin/sh
if [ "$1" == "wired" ]; then
IFACE=eth0
else
IFACE=wlan0
fi
if [ "$2" == "trusted0" ]; then
MAC="ff:ee:bb:cc:dd:aa"
else
MAC=$(/home/e/bin/macgen)
fi
if [ "$2" == "trusted1" ]; then
MAC="aa:bb:cc:dd:ee:ff"
else
MAC=$(/home/e/bin/macgen)
fi
ip link set $IFACE down
ip link set dev $IFACE address $MAC
ip link set $IFACE up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment