#!/bin/sh # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-power/acpid/files/acpid-1.0.4-default.sh,v 1.1 2005/03/15 19:15:53 ciaranm Exp $ # Default acpi script that takes an entry for all actions set $* group=${1/\/*/} action=${1/*\//} restoreclock() { # set system clock from hw clock hwclock --hctosys --utc } prestop() { if /sbin/lsmod | grep hsfserial > /dev/null ;then logger "$0 unload hsf modem" /usr/sbin/hsfconfig --rcstop fi # sync hardware clock with system time #hwclock --systohc --utc sync } case "$group" in ibm) case "$action" in hotkey) #/etc/acpi/default.sh ibm/hotkey HKEY 00000080 00001004 if [ "$3" = "00000080" -a "$4" = "00001004" ]; then logger "$0 suspend to ram" prestop acpitool -s restoreclock fi ;; *) logger "ACPI action $action is not defined" ;; esac ;; button) case "$action" in lid|sleep) # /etc/acpi/default.sh button/sleep SLPB 00000080 00000002 #/etc/acpi/default.sh button/lid LID 00000080 0000000X # X will count up if [ "$3" = "00000080" ]; then logger "$0 suspend to ram" prestop acpitool -s restoreclock fi ;; power) /sbin/init 0 ;; *) logger "ACPI action $action is not defined" ;; esac ;; *) logger "ACPI group $group / action $action is not defined" ;; esac