[mca1001] / doodles / apmd-wall-local  

mca1001: doodles/apmd-wall-local

File: [mca1001] / doodles / apmd-wall-local (download)
Revision: 1.1, Thu Sep 14 16:54:31 2006 UTC (3 years, 11 months ago) by mca1001
Branch: MAIN
CVS Tags: HEAD
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
(Powered by ViewCVS)

ViewCVS and CVS Help