2008-11-28 12:44:14 +01:00
|
|
|
#!/bin/sh -e
|
|
|
|
# Nico Schottelius, 20080910 11:09
|
2009-04-17 20:09:01 +02:00
|
|
|
# The initial version
|
|
|
|
#
|
|
|
|
# udhcpc -nfqi wlan0 && vpnc ~nico/ethz/vpn/pc.conf
|
|
|
|
#
|
|
|
|
# Failed due to many reasons. See the working hack/version below.
|
|
|
|
#
|
|
|
|
#
|
2009-01-30 12:28:47 +01:00
|
|
|
#ip link set wlan0 down
|
|
|
|
#iwconfig wlan0 essid public
|
|
|
|
#ip link set wlan0 up
|
|
|
|
#iwconfig wlan0 essid public
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
2010-07-12 22:47:21 +02:00
|
|
|
#ip l s eth0 down
|
2011-10-08 14:44:17 +02:00
|
|
|
# Ensure previous wpa_supplicant is not running
|
2010-04-15 12:21:43 +02:00
|
|
|
( wpa_cli terminate || exit 0 )
|
2009-08-14 14:04:06 +02:00
|
|
|
|
2011-10-08 14:44:17 +02:00
|
|
|
# Ensure the adapter works, reloading the driver helps
|
|
|
|
( rmmod iwlagn; modprobe iwlagn; sleep 2 )
|
2009-08-14 14:04:06 +02:00
|
|
|
|
2009-01-30 12:28:47 +01:00
|
|
|
wpa_supplicant -B -Dwext -iwlan0 -c ~nico/ethz/wlan/wpa_supplicant.conf
|
2011-10-08 14:44:17 +02:00
|
|
|
# Give wpa some time to connect
|
2009-01-30 12:28:47 +01:00
|
|
|
sleep 5
|
2011-10-08 14:44:17 +02:00
|
|
|
|
|
|
|
# Choose an dhcp client
|
2010-04-15 12:21:43 +02:00
|
|
|
( udhcpc -nqfi wlan0 || dhcpcd wlan0 )
|
2009-01-30 12:28:47 +01:00
|
|
|
|
2011-10-08 14:44:17 +02:00
|
|
|
# vpnc ~nico/ethz/vpn/sg.conf
|
2009-01-30 12:28:47 +01:00
|
|
|
#vpnc ~nico/firmen/ethz/vpn/vpnc.conf
|
|
|
|
# vpnc-disconnect
|