https://bugzilla.novell.com/show_bug.cgi?id=412527
User rens.groenewegen@xs4all.nl added comment
https://bugzilla.novell.com/show_bug.cgi?id=412527#c20
--- Comment #20 from rens groenewegen 2008-11-04 17:50:41 MST ---
here's a script I made to avoid having to do the manual thing.
it never failed me.
"psg" is a script that simply kills a process by name.
basically this script kills all relevant processes, tries to get associated,
tries the dhcp server and if succesfull requests a dhcp config.
it keeps doing that until succesfull.
=>cat dowifi
#!/bin/ksh
set -x
function setoff
{
set -x
ifdown wlan0
ifconfig wlan0 down
psg -nK wpa_supplicant
psg -nK dhcpcd
psg -nK dhclient
}
function iwscan
{
set -x
iwlist wlan0 scan > /tmp/wilist
return $?
}
function setonwpa
{
set -x
[ $# -lt 1 ] && return 1
psg -nK wpa_supplicant
psg -nK dhcpcd
psg -nK dhclient
iwconfig|grep wlan0
ifconfig|grep wlan0
wpa_supplicant -i wlan0 -c $1 -B
return $?
}
function testdhc
{
set -x
err=`dhcpcd-test wlan0 2>&1|grep -c -i timed`
return $err # ok = 0, error = 1
}
function dodhc
{
set -x
dhcpcd wlan0
return $?
}
function waitforlink
{
while [ ` iwconfig |grep -c -i not-associated ` -gt 0 ]
do
sleep 2
echo -n "."
done
return $?
}
while true
do
setoff
iwscan
setonwpa $1 && waitforlink && testdhc && dodhc && break
done
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.