#!/bin/sh # # hal-system-system-power-suspend-sunos.sh # # Licensed under the Academic Free License version 2.1 # proc alarm_not_supported { echo org.freedesktop.Hal.Device.SystemPowerManagement.AlarmNotSupported >&2 echo Waking the system up is not supported >&2 exit 1 } proc unsupported { echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >&2 echo No suspend method found >&2 exit 1 } read seconds_to_sleep if test $seconds_to_sleep != "0" { alarm_not_supported } if test -x "/usr/sbin/uadmin" { /usr/sbin/uadmin 3 20 setvar RET = "$Status" } else { unsupported } #Refresh devices as a resume can do funny things for type in [button battery ac_adapter] { setvar devices = $(hal-find-by-capability --capability $type) for device in [$devices] { dbus-send --system --print-reply --dest=org.freedesktop.Hal \ $device org.freedesktop.Hal.Device.Rescan } } exit $RET