### END INIT INFO
set -e
# Exit if modprobe package is not installed
[ -f /sbin/modprobe ] || exit 0
MYNAME="Wifi Driver ipw3945"
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# $* MESSAGE
warn() { echo "${MYNAME}: Warning: $* " >&2 ; }
# $* MODULE-NAME [MODULE-NAME]... | "all"
unload_modules()
{
modprobe -r ipw3945
}
load_unloaded_modules()
{
modprobe ipw3945
#establecer la clave por defecto
sleep 10
iwconfig eth2 key [1]
}
case "$1" in
unload|stop)
unload_modules all || exit $?
;;
reload|start)
EXITSTATUS=0
unload_modules all || EXITSTATUS=1
load_unloaded_modules || EXITSTATUS=1
exit $EXITSTATUS
;;
*)
echo "Usage: $MYNAME {unload|reload|start|stop}" >&2
exit 3
;;
esac
3.
Se puede utilizar la configuración directa en /etc/network/interfaces
iface eth2 inet dhcp
wireless-mode managed
wireless-essid wireless3Com
wireless-key1 aeiou ...
wireless-key2 aeiou ...
wireless-key3 aeiou ...
wireless-key4 aeiou ...
wireless-defaultkey 1
wpa-conf managed
wpa-ssid MISSID
wpa-key-mgmt WPA-PSK
wpa-psk la_clave_generada_con_wpa_passphrase