#!/bin/bash
DEV=wlan0

if [[ $UID != 0 ]]; then echo "You are not root. To insert the module into your kernel, you need to be root. Enter su and try again. Bailing..."; exit 1; fi

IFCONF=`which ifconfig`
RMMOD=`which rmmod`

if [[ $IFCONF == "" ]]; then echo "Can't deconfigure interface, and likely not
unload module."; else $IFCONF $DEV down; fi

sleep 1
if [[ $RMMOD == "" ]]; then echo "rmmod not found. Go get a sane Linux system. Bailing..."; exit 1; fi 
$RMMOD acx100_pci
if [[ $? == 0 ]]; then echo "$DEV deconfigured, module unloaded."; else echo "Module not unloaded, or wasn't loaded."; fi

