#!/bin/sh # /etc/acpi/sleepbtn.sh # Initiates a shutdown when the sleep putton has been # pressed. run-parts --arg=suspend --arg=user /etc/apm/event.d if [ -d /etc/apm/suspend.d ]; then run-parts --arg=suspend --arg=user /etc/apm/suspend.d fi if [ -x /etc/init.d/hotplug ]; then /etc/init.d/hotplug stop fi if [ -f /sys/power/state ]; then echo mem > /sys/power/state else echo 3 >/proc/acpi/sleep fi if [ -x /etc/init.d/hotplug ]; then /etc/init.d/hotplug start fi if [ -d /etc/apm/resume.d ]; then run-parts --arg=resume --arg=suspend /etc/apm/resume.d fi run-parts --arg=resume --arg=suspend /etc/apm/event.d