#! /bin/sh
#
# skeleton	example file to build /etc/init.d/ scripts.
#		This file should be used to construct scripts for /etc/init.d.
#
#		Written by Miquel van Smoorenburg <miquels@cistron.nl>.
#		Modified for Debian 
#		by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#               Adapted for athcool by Nicolas Boullis <nboullis@debian.org>.
#
# Version:	@(#)skeleton  1.9  26-Feb-2001  miquels@cistron.nl
#

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PROG=/usr/sbin/athcool

test -x $PROG || exit 0

set -e

case "$1" in
    start)
	echo -n "Enabling Athlon powersaving mode..."
	if $PROG on > /dev/null; then
	    echo "done."
	else
	    echo "failed."
	fi
	;;
    stop)
	echo -n "Disabling Athlon powersaving mode..."
	if $PROG off > /dev/null; then
	    echo "done."
	else
	    echo "failed."
	fi
	;;
  restart|force-reload)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: /etc/init.d/athcool {start|stop|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0
