#!/bin/sh
#Macchanger-Script
#Script by CAG (aka BobaFett)
#May 2010 (updated June 2010)
#This is a very simple script thats soul purpose is to change the mac address of the specified card (WIFIMAN) to the specified mac address (MACSPOOF).
#To run script, paste it into an empty text file and save it as "Macchanger-Script" (or whatever you like), modify the "Customizable Variables" section to meet your needs, make it executable using chmod, or simply right click->properties->permissions->check "is executable", then type ./Macchanger-Script in terminal.
############### Customizable Variables ################
#You must change these to meet your system needs
WIFIMAN="wlan0" #Your card interface (i.e. wlan0, eth0, etc)
MACSPOOF="00:11:22:33:44:55" #Mac that macchanger defaults too. Can be any mac address
############### Customizable Variables ################
################## Static Variables ###################
#Don't change any of these variables unless you know what you're doing
ROOT_UID=0 # Only users with $UID 0 have root privileges.
E_NOTROOT=87 # Non-root exit error.
################## Static Variables ###################
if [ "$UID" -ne "$ROOT_UID" ]
then
echo "Must be root to run this script."
exit $E_NOTROOT
fi
ifconfig $WIFIMAN down
macchanger $WIFIMAN -m $MACSPOOF
ifconfig $WIFIMAN up