#!/bin/sh

# Simple suspend script
# Based on work from:
#    Bill Nottingham <notting@redhat.com>
#    Peter Jones <pjones@redhat.com>
#    David Zeuthen <davidz@redhat.com>

# The rule here? Simplicity.

export PM_MODE="sleep"

[ -f /sys/power/state ] || exit 1

. /etc/pm/functions

take_suspend_lock || exit 1

run_hooks suspend

sync ; sync ; sync

echo -n "mem" > /sys/power/state

run_hooks resume reverse

remove_suspend_lock 200

