#!/bin/bash
#
# athcool	This scripts runs athcool, enabling/disabling
#		powersaving mode for Athlon/Duron processors.
#
# chkconfig: 2345 10 90
# description: 	This scripts runs athcool, enabling/disabling \
#		powersaving mode for Athlon/Duron processors.

PROG=/usr/sbin/athcool
RETVAL=$?

test -x $PROG || exit 0

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
	;;
    status)
	echo -n "Query Athlon powersaving mode..."
	$PROG stat
	;;
    restart|force-reload)
	$0 stop
	$0 start
	;;
    *)
	echo "Usage: /etc/init.d/athcool {start|stop|status|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0
