~ubuntu-branches/ubuntu/karmic/powersave/karmic

« back to all changes in this revision

Viewing changes to scripts/do_acpi_sleep

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2006-01-13 21:38:52 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060113213852-lqnirx6tfj6q76jv
Tags: 0.11.2-1
* New upstream release.
* Removed patches shebang_fix.diff, awk_path_fix.diff and
  wttyhx_fixes.diff, all merged upstream.
* hal and dbus are now mandatory. Added the corresponding dependencies to
  debian/control.
* Added powersaved.postinst, dbus needs to be reloaded after powersaved has
  been installed. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/bash
 
2
###########################################################################
 
3
#                                                                         #
 
4
#                         Powersave Daemon                                #
 
5
#                                                                         #
 
6
#          Copyright (C) 2004,2005 SUSE Linux Products GmbH               #
 
7
#                                                                         #
 
8
# This program is free software; you can redistribute it and/or modify it #
 
9
# under the terms of the GNU General Public License as published by the   #
 
10
# Free Software Foundation; either version 2 of the License, or (at you   #
 
11
# option) any later version.                                              #
 
12
#                                                                         #
 
13
# This program is distributed in the hope that it will be useful, but     #
 
14
# WITHOUT ANY WARRANTY; without even the implied warranty of              #
 
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       #
 
16
# General Public License for more details.                                #
 
17
#                                                                         #
 
18
# You should have received a copy of the GNU General Public License along #
 
19
# with this program; if not, write to the Free Software Foundation, Inc., #
 
20
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA                  #
 
21
#                                                                         #
 
22
###########################################################################
 
23
 
2
24
# invoke acpi suspend and APM suspend to disk
3
25
#   the name of this script is a leftover from non-APM days...
4
26
12
34
    exit 126
13
35
fi
14
36
 
 
37
. $SYSCONF_DIR/sleep
 
38
HWCLOCK="/sbin/hwclock"
 
39
OPT="--hctosys"
 
40
 
15
41
# blank the "suspend console"
16
42
deallocvt 63
17
43
 
19
45
    suspend2disk)
20
46
        echo disk > /sys/power/state
21
47
        RET=$?
 
48
        [ "$SUSPEND2DISK_RESTORE_CLOCK" == "yes" ] && $HWCLOCK $OPT
22
49
        ;;
23
50
    suspend2ram)
24
51
        echo mem > /sys/power/state
25
52
        RET=$?
 
53
        [ "$SUSPEND2RAM_RESTORE_CLOCK" == "yes" ] && $HWCLOCK $OPT
26
54
        ;;
27
55
    standby)
28
56
        echo standby > /sys/power/state
29
57
        RET=$?
 
58
        [ "$STANDBY_RESTORE_CLOCK" == "yes" ] && $HWCLOCK $OPT
30
59
        ;;
31
60
    *)  echo "Wrong parameter in $0"
32
61
        RET=126