|
Written by Bart Dorlandt
|
|
Friday, 29 December 2006 11:45 |
|
I used this script for FreeBSD and for Linux Ubuntu 6.06. Since I use 7.04 with the Network manager Applet I haven't been using this script anymore. Also because I don't have FreeBSD no more.
Here is a sample config
#!/bin/bash
# wireless-enable.sh
LinuxWPA() {
ifconfig eth1 up
ifconfig eth0 down
echo "execute wpa_supplicant, sleep 10"
/sbin/wpa_supplicant -i eth1 -c /etc/conf/wireless/wpa_supplicant.conf -D ipw & >/dev/null 2>&1
sleep 10
echo "retrieve IP adress"
/sbin/dhclient eth1 >/dev/null 2>&1
ifconfig eth1
}
FreebsdWPA() {
ifconfig bge0 down
echo "load drivers"
# /sbin/kldload -v if_iwi wlan_wep wlan_ccmp wlan_tkip
/sbin/kldload -v if_iwi wlan_acl wlan_wep wlan_ccmp wlan_tkip
echo "load firmware"
/usr/sbin/iwicontrol -i iwi0 -d /boot/firmware -m bss
echo "execute wpa_supplicant, sleep 10"
/sbin/wpa_supplicant -i eth1 -c /etc/conf/wireless/wpa_supplicant.conf & >/dev/null 2>&1
sleep 10
echo "retrieve IP adress"
/sbin/dhclient iwi0 >/dev/null 2>&1
ifconfig iwi0
}
MACHINE=`uname`
if [ "$MACHINE" = "Linux" ]; then
LinuxWPA
else
if [ "$MACHINE" = "FreeBSD" ]; then
FreebsdWPA
fi
fi
|
|
Last Updated on Tuesday, 20 November 2007 17:51 |