#!/bin/sh PROGNAME=`basename $0` info() { echo "$PROGNAME: INFO: $1">&2 } error() { echo "$PROGNAME: ERROR: $1">&2 exit 1 } info "downing conflicting interfaces ..." ifdown dummy0 # even though it is down things are still listening on it. this stops them. rmmod dummy info "reloading modules ..." for I in 2 1 0; do MODS=`lsmod | grep ath | awk '{ print $1 }'` [ "X$MODS" != X ] || break rmmod $MODS done [ $I != 0 ] || error "failed to purge modules" sleep 5 modprobe ath_pci sleep 5 case "$1" in union) info "faking NIC ..." macchanger -m 00:50:F2:CE:1B:E7 ath0 iwconfig ath0 key [1] 1BFB20B423B2A3AF1D1A6C2A9E essid Union info "requesting an IP ..." dhclient ath0 ;; netgear) macchanger -m 00:30:65:0F:6F:DA ath0 iwconfig ath0 essid NETGEAR channel 11 ;; xwlan) ap: 00:A0:C5:DA:27:E9 pc: 00:0E:35:73:7D:F8 ;; clear) : ;; esac