quick hack for apmd
#! /bin/sh
# Warn users of system about powercuts. Used on an old laptop "server" with
# a dodgy battery.
#
# $Id: apmd-wall-local,v 1.1 2006/09/14 16:54:31 mca1001 Exp $
#
# Copyright waived, use this as you see fit.
# Install as /etc/apm/event.d/wall-local on a Debian box with 'apmd' running.
if [ "${1}" = "start" -o "${1}" = "stop" ]; then
# no action for daemon start/stop
exit 0
fi
STATE=`apm | grep -v On-line`
if [ "${STATE}" != "" ]; then
echo -e "APM event: $* (brought to you by $0)\n'apm' output: $STATE\nnb. the battery is flaky..." | /usr/bin/wall
fi
|
Repository owner Powered by ViewCVS 1.0-dev |
ViewCVS and CVS Help |