3 source /etc
/acpi
/eee.conf
5 PWR
=$
(cat /proc
/acpi
/asus
/wlan ||
cat /sys
/devices
/platform
/eeepc
/wlan
)
20 if [ "$PWR" = "0" ]; then
21 modprobe pciehp pciehp_force
=1
23 echo 1 > /proc
/acpi
/asus
/wlan
24 echo 1 > /sys
/devices
/platform
/eeepc
/wlan
26 echo "Loading wlan modules..."
29 echo "Creating wlan interface"
30 logger
"create wlan interface"
31 wlanconfig ath0 create wlandev wifi0 wlanmode sta nosbeacon
34 # Loop to the eternity!!! bawwaawawa, well once should be enough. >)
35 if ifconfig ath0
> /dev
/null
37 echo "Running network up command!"
38 if [ -e /tmp
/eeewlanfailcounter
]; then rm /tmp
/eeewlanfailcounter
;fi
39 (sleep 1; $NETWORK_UP_COMMAND) &
41 FAILC
=$
(</tmp
/eeewlanfailcounter
) || FAILC
=0
42 echo "Current fail count is $FAILC"
45 logger
"Could not bring up WLAN."
46 echo "Could not bring up WLAN, sorry. See dmesg for more information!"
49 echo $
(expr $FAILC + 1) > /tmp
/eeewlanfailcounter
50 /etc
/acpi
/wlan.sh poweroff
51 /etc
/acpi
/wlan.sh poweron
59 if [ "$PWR" = "1" ]; then
60 logger
"remove wlan interface"
61 echo "Removing wlan interface and unloading modules"
64 wlanconfig ath0 destroy
66 echo "Turning wlan device power off"
67 echo 0 > /proc
/acpi
/asus
/wlan
68 echo 0 > /sys
/devices
/platform
/eeepc
/wlan
72 echo "Running network down command"
73 (sleep 1; $NETWORK_DOWN_COMMAND) &