home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / hal / scripts / linux / hal-system-power-set-power-save-linux < prev    next >
Encoding:
Text File  |  2009-07-05  |  451 b   |  28 lines

  1. #!/bin/sh
  2.  
  3. value=$1
  4.  
  5. unsupported() {
  6.     echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >&2
  7.     echo No powersave method found >&2
  8.     exit 1
  9. }
  10.  
  11. # We only support pm-utils
  12. if [ -x "/usr/sbin/pm-powersave" ] ; then
  13.     if [ $value = "true" ]; then
  14.         /usr/sbin/pm-powersave true
  15.         RET=$?
  16.     elif [ $value = "false" ]; then
  17.         /usr/sbin/pm-powersave false
  18.         RET=$?
  19.     fi
  20.  
  21. else
  22.     # cannot set proc stuff here, so error out
  23.     unsupported
  24.     fi 
  25.  
  26. exit $RET
  27.  
  28.