Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Ticket #182: wifi-up

File wifi-up, 1.3 kB (added by mrenzmann, 14 years ago)

Local copy of wifi-up script. See ticket description.

Line 
1 #! /bin/bash
2
3   for var in IFACE essid key wlanmode ; do
4     if test -z "${!var}" ; then
5            1>&2 echo  "wifi-up: missing arg '$var'"
6            exit 1
7     fi
8   done
9
10   echo ... start of wifi-up $IFACE
11   modprobe ath_pci              ## may or may not be necessary
12  ## ifconfig $IFACE down        ## not necessary; dhclient3 will down the device
13
14  #!!! The following line is a disaster:
15  #!!!   wlanconfig $IFACE destroy || true
16  #!!! apparently it does something like "dhclient3 -r"
17  #!!! and does it asynchronously, creating a race. 
18    #!!! The weirdest part is that I see a "RELEASE" message
19    #!!! in /var/log/daemon.log
20    #!!! but I don't see debug-printouts from dhclient-script.
21  #!!! In any case, the result is that the dhcp lease is released
22  #!!! within milliseconds of being acquired.
23  #!!!
24  #!!! The following is no better, although (sometimes?) harmless if the device has
25  #!!! already been destroyed.
26  #!!!   if wlanconfig $IFACE destroy ; then
27  #!!!     echo '(needed destroying)'
28  #!!!     sleep 30
29  #!!!   else
30  #!!!     echo '(fresh)'
31  #!!!   fi
32
33   if wlanconfig $IFACE list > /dev/null 2>/dev/null ; then
34     echo "(Didn't need creating)"
35   else
36     wlanconfig $IFACE create wlandev wifi0 wlanmode $wlanmode
37   fi
38   iwpriv $IFACE mode 2  ## 801.11b
39   iwconfig $IFACE essid $essid
40   iwconfig $IFACE key $key [1]
41   iwconfig $IFACE key [1]
42   echo ... end of wifi-up