#!/bin/sh
if [ `whoami` != "root" ]; then
	echo "You must be root to run this script."
	return
fi
. unload
unset LOADED
for i in firmware_class; do
	if ! lsmod | grep -q $i; then
	    modprobe $i && LOADED="${LOADED}${i} "
	fi
done
for i in ieee80211_crypt ieee80211 ieee80211_crypt_wep; do
	if [ -e $i.ko ]; then
		insmod ./$i.ko && LOADED="${LOADED}${i} "
	fi
done
if [ -z $1 ]; then
	insmod ./ipw2200.ko debug=$((255+0x1000)) && LOADED="${LOADED}ipw2200 "
else
	insmod ./ipw2200.ko $@ && LOADED="${LOADED}ipw2200 "
fi
if [ -z "${LOADED}" ]; then
	echo "No modules loaded."
else
	echo "Loaded: ${LOADED}"
fi

