File: hal-system-power-set-power-save-linux

package info (click to toggle)
hal 0.5.14-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 10,212 kB
  • ctags: 4,854
  • sloc: ansic: 60,732; xml: 16,387; sh: 11,366; makefile: 1,111; cpp: 292
file content (27 lines) | stat: -rwxr-xr-x 451 bytes parent folder | download | duplicates (3)
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
#!/bin/sh

value=$1

unsupported() {
	echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >&2
	echo No powersave method found >&2
	exit 1
}

# We only support pm-utils
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
	# cannot set proc stuff here, so error out
	unsupported
	fi 

exit $RET