8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / hal / tools / sunos / hal-system-power-suspend-sunos.sh
blob5617b61f6fcf8d7b9e62e318aff6abf8232b5c2d
1 #!/bin/sh
3 # hal-system-system-power-suspend-sunos.sh
5 # Licensed under the Academic Free License version 2.1
8 alarm_not_supported() {
9 echo org.freedesktop.Hal.Device.SystemPowerManagement.AlarmNotSupported >&2
10 echo Waking the system up is not supported >&2
11 exit 1
14 unsupported() {
15 echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >&2
16 echo No suspend method found >&2
17 exit 1
20 read seconds_to_sleep
21 if [ $seconds_to_sleep != "0" ] ; then
22 alarm_not_supported
25 if [ -x "/usr/sbin/uadmin" ] ; then
26 /usr/sbin/uadmin 3 20
27 RET=$?
28 else
29 unsupported
32 #Refresh devices as a resume can do funny things
33 for type in button battery ac_adapter
35 devices=`hal-find-by-capability --capability $type`
36 for device in $devices
38 dbus-send --system --print-reply --dest=org.freedesktop.Hal \
39 $device org.freedesktop.Hal.Device.Rescan
40 done
41 done
43 exit $RET