#!/bin/sh
#
# rc.wireless.madwifi.sh
#
# For Installing Madwifi-based Wireless System
# =============================================
#
#
# Original File
# -------------
#	http://Madwifi.net/Install-HOWTO/WireLess.Install/rc.wireless.madwifi.sh
#
#
# If you use WEP
# --------------
#	http://Madwifi.net/Install-HOWTO/WireLess.Install/WEP-Key-HOWTO.txt
#
#
# If you want to WPA
# -------------------
#	http://Madwifi.net/Install-HOWTO/WireLess.Install/WPA-Key-HOWTO.txt
#
#
# 10-Dec-03 amo Modified http://Madwifi.net/Install-HOWTO/wl.install.sh
# 22-Jun-04 amo From http://www.unoc.net/a/linux.html
# 21-Feb-05 amo Cleanup for i-Sniff.net SnifferCD
#
#
# 
SSID="AnyESSID"
#
NICK="Wireless"
#
#
# If you use WEP
# --------------
# KEY=XXXXXXXXXXXXXXXXXXXXXXXXXX
#
#
# Wireless Connection parameters
# ==========================================================
#	#
#	# you will need to change thse ip# values for your network
#	#
INTERFACE=ath0
#
IPADDR=192.168.1.200
#
BROADCAST=192.168.1.255
NETMASK=255.255.255.0
#
GATEWAY=192.168.1.1
#
#
# ==========================================================
#	#
#	# you should not need to change anything below here
#	#
# ==========================================================
#
# /sbin/ifconfig lo up
#
#
# Reset the wireless network
# --------------------------
/sbin/route del default
/sbin/ifconfig $INTERFACE down
#
/sbin/rmmod ath_pci
/sbin/rmmod ath_rate_onoe
/sbin/rmmod ath_hal
/sbin/rmmod wlan_wep
/sbin/rmmod wlan
#
#
# Install the wireless network
# ----------------------------
/sbin/modprobe ath0_pci
/sbin/modprobe wlan_wep
#
/sbin/ifconfig $INTERFACE $IPADDR netmask $NETMASK broadcast $BROADCAST up
/sbin/iwconfig $INTERFACE essid $SSID nick $NICK
/sbin/iwconfig $INTERFACE key $KEY
#sbin/iwconfig $INTERFACE enc restricted
#
/sbin/route add default gw $GATEWAY
#
# echo "nameserver $GATEWAY" > /etc/resolv.conf
#
#
# End of file

