wireless-wpa.sh:

#!/bin/bash
iface=wlan0
ifconfig $iface down
iwconfig $iface mode Managed
ifconfig $iface up
killall wpa_supplicant
wpa_supplicant -B -Dwext -i $iface -c wireless-wpa.conf -dd
dhclient $iface

wireless-wpa.conf:

ctrl_interface=/var/run/wpa_supplicant
network={
ssid=””
scan_ssid=1
key_mgmt=WPA-PSK
psk=”” # password
}

Advertisements