#! /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 GNU/Linux
#		by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
# Version:	@(#)skeleton  1.8  03-Mar-1998  miquels@cistron.nl
#
# This file was automatically customized by dh-make on Fri, 16 Jul 1999 11:01:42 -0700

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/powertweak
CONFIG=/etc/powertweak.config
NAME=powertweak
DESC=powertweak

test -f $DAEMON || exit 0

set -e

case "$1" in
  start)
	echo -n "Starting $DESC: "
    if [ -f $CONFIG ];
	then
		start-stop-daemon --start --quiet --exec $DAEMON
	else
		echo "Did not find $CONFIG.  Not starting."
		echo "Run powertweak-config to create $CONFIG"; 
		exit 0
	fi
	;;
  restart)
	echo -n "Restarting $DESC: "
	start-stop-daemon --start --quiet --exec $DAEMON
	;;
  stop)
	;;
  *)
	N=/etc/init.d/$NAME
	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
	echo "Usage: $N {start|restart}" >&2
	exit 1
	;;
esac

exit 0
