#!/bin/sh # written by spirit # connect to WPA-encrypted WLAN (i.e. FLUGHAFEN) # remember to adapt /etc/wpa_supplicant.conf to your needs! # you must also enable wpa_supplicant in /etc/default/wpasupplicant! ### settings -- adapt these to your needs ### # your wireless adapter (wlan device) DEVICE="eth1" #other ethernet cards that should be disabled DISABLE="eth0" #driver name (kernel module) of your wireless adapter DRIVER="ipw2100" #the driver alias wpa_supplicant uses for your card # (see "wpa_supplicant -help" for possible values) WPADRIVERALIAS="wext" #name of the wireless LAN you want to connect to ESSID="FLUGHAFEN" #your wpa_supplicant config file WPACONF="/etc/wpa_supplicant.conf" ### programs we need ### modprobe=$(which modprobe) ifconfig=$(which ifconfig) iwconfig=$(which iwconfig) dhclient=$(which dhclient) wpasupplicant=$(which wpa_supplicant) ### here we go ### echo "==> configuring interfaces for $ESSID..." # setup wlan $modprobe $DRIVER $ifconfig $DEVICE up $ifconfig $DISABLE down $iwconfig $DEVICE mode managed $iwconfig $DEVICE ap any $iwconfig $DEVICE rate auto $iwconfig $DEVICE essid $ESSID # enable wpa support $wpasupplicant -i$DEVICE -D$WPADRIVERALIAS -c $WPACONF -B # get ip configuration from AP $dhclient $DEVICE # we're done echo "==> done. don't forget to stop wpa_supplicant when you're done via :" echo "==> /etc/init.d/wpasupplicant stop"