home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-02.iso
/
boot
/
i386
/
rescue
/
usr
/
lib
/
hal
/
scripts
/
linux
/
hal-system-power-set-power-save-linux
< prev
next >
Wrap
Text File
|
2006-11-29
|
898b
|
45 lines
#!/bin/sh
read value
unsupported() {
echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >&2
echo No powersave method found >&2
exit 1
}
#SuSE and ALTLinux only support powersave
if [ -f /etc/altlinux-release ] || [ -f /etc/SuSE-release ] ; then
if [ -x "/usr/bin/powersave" ] ; then
if [ $value = "true" ]; then
/usr/bin/powersave -e Powersave
RET=$?
elif [ $value = "false" ]; then
/usr/bin/powersave -e Performance
RET=$?
fi
else
unsupported
fi
#RedHat/Fedora only support pm-utils
elif [ -f /etc/redhat-release ] || [ -f /etc/fedora-release ] ; then
if [ -x "/usr/sbin/pm-powersave" ] ; then
if [ $value = "true" ]; then
/usr/sbin/pm-powersave true
RET=$?
elif [ $value = "false" ]; then
/usr/sbin/pm-powersave false
RET=$?
fi
else
unsupported
fi
else
# cannot set proc stuff here, so error out
unsupported
fi
exit $RET