summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/wlan-ng26-utils/tmp/trunk/etc/wlan/.svn/text-base/wlan-udev.sh.svn-base
blob: 879dd140f99abd1456aa72edd92902619cbbc62e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#! /bin/bash


# script to start prism2 wlan for fedora FC5 udev 
#udev rule
#ACTION=="add",BUS=="usb",DRIVER=="prism2_usb",RUN+="/etc/wlan/wlan-udev.sh %k"

# 01-01-2007 (rsk) add check for wlan_wext_write
# 31-01-2007 (rsk) get the check right this time :)

WEXT_PARAM=/sys/module/p80211/parameters/wlan_wext_write

DEVICE=$1
WLAN_UDEV=1

. /etc/wlan/shared

if [ -f $WEXT_PARAM ]; then
    WLAN_WEXT=`cat $WEXT_PARAM`
fi

if [ $WLAN_WEXT = 1 ]; then
    wlan_bring_it_up $DEVICE TRUE
	# set encrypt on card not host
	result=`$WLANCTL $DEVICE lnxreq_hostwep decrypt="false" encrypt="false"`
	if [ $? != 0 ]; then
	    echo "Cannot enable wep $result"
	    exit 1
	fi
else
    echo calling wlan_bring_it_up
    wlan_bring_it_up $DEVICE

    if [ $? = 0 ] ; then
	echo $DEVICE start OK
        #allow time during boot to let other things start
	#sleep 5
	/sbin/ifup $DEVICE
    else
	echo $DEVICE failed to come up! >&2
	exit 1
    fi
fi
exit 0