home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / acpi-support / state-funcs < prev    next >
Encoding:
Text File  |  2006-08-23  |  727 b   |  28 lines

  1. #!/bin/sh
  2. # Paul Sladen, 2006-03-28
  3. # Library functions to check status of wireless
  4.  
  5. isAnyWirelessPoweredOn()
  6. {
  7.     for DEVICE in /sys/class/net/* ; do
  8.     if [ -d $DEVICE/wireless -a -r $DEVICE/device/power/state ] ; then
  9.         # If any of the wireless devices are turned off then return failure
  10.         test "`cat $DEVICE/device/power/state`" -eq 0 || return
  11.     fi
  12.     done
  13.     # otherwise return success
  14.     return 0
  15. }
  16.  
  17. setLEDThinkpadSuspending()
  18. {
  19.     action=`test "$1" -ne 0 && echo blink || echo off`
  20.     test -w /proc/acpi/ibm/led && echo -n 7 "$action" > /proc/acpi/ibm/led
  21. }
  22.  
  23. setLEDAsusWireless()
  24. {
  25.     action=`test "$1" -ne 0 && echo 1 || echo 0`
  26.     test -w /proc/acpi/asus/wled && echo -n "$action" > /proc/acpi/asus/wled
  27. }
  28.