nsbin/wlan
Nico Schottelius d4421e8605 update wlan script
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
2011-10-08 14:44:17 +02:00

33 lines
775 B
Bash
Executable file

#!/bin/sh -e
# Nico Schottelius, 20080910 11:09
# The initial version
#
# udhcpc -nfqi wlan0 && vpnc ~nico/ethz/vpn/pc.conf
#
# Failed due to many reasons. See the working hack/version below.
#
#
#ip link set wlan0 down
#iwconfig wlan0 essid public
#ip link set wlan0 up
#iwconfig wlan0 essid public
set -x
#ip l s eth0 down
# Ensure previous wpa_supplicant is not running
( wpa_cli terminate || exit 0 )
# Ensure the adapter works, reloading the driver helps
( rmmod iwlagn; modprobe iwlagn; sleep 2 )
wpa_supplicant -B -Dwext -iwlan0 -c ~nico/ethz/wlan/wpa_supplicant.conf
# Give wpa some time to connect
sleep 5
# Choose an dhcp client
( udhcpc -nqfi wlan0 || dhcpcd wlan0 )
# vpnc ~nico/ethz/vpn/sg.conf
#vpnc ~nico/firmen/ethz/vpn/vpnc.conf
# vpnc-disconnect