#!/bin/sh # Jeff Brown # October 27, 2010 # Version: 1.0 # http://photonicsguy.ca/eeepc/ DELAY=30m # Delay SUSPEND=/etc/acpi/suspend2ram.sh # Program to call after timeout ################################################################## NAME=`basename $0` if [ $NAME = "suspendtimeout.sh" ]; then sleep $DELAY $SUSPEND elif [ $NAME = "cancelsuspend.sh" ]; then PID=`pgrep suspendtimeout` if [ $? != 0 ]; then echo "Error, can't find suspendtimeout" else kill -TERM $PID if [ $? != 0 ]; then echo "ERROR, can't terminate suspendtimeout, process $PID" fi fi fi exit 0