blob: 5617b61f6fcf8d7b9e62e318aff6abf8232b5c2d (
plain)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#!/bin/sh
#
# hal-system-system-power-suspend-sunos.sh
#
# Licensed under the Academic Free License version 2.1
#
alarm_not_supported() {
echo org.freedesktop.Hal.Device.SystemPowerManagement.AlarmNotSupported >&2
echo Waking the system up is not supported >&2
exit 1
}
unsupported() {
echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >&2
echo No suspend method found >&2
exit 1
}
read seconds_to_sleep
if [ $seconds_to_sleep != "0" ] ; then
alarm_not_supported
fi
if [ -x "/usr/sbin/uadmin" ] ; then
/usr/sbin/uadmin 3 20
RET=$?
else
unsupported
fi
#Refresh devices as a resume can do funny things
for type in button battery ac_adapter
do
devices=`hal-find-by-capability --capability $type`
for device in $devices
do
dbus-send --system --print-reply --dest=org.freedesktop.Hal \
$device org.freedesktop.Hal.Device.Rescan
done
done
exit $RET
|