#! /bin/sh

### BEGIN INIT INFO
# Provides:          timekpr
# Required-Start:    $remote_fs
# Required-Stop:     $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Timekpr - Keep control of computer usage
# Description:       This program will track and control the computer usage
#                    of your kids. You can limit their daily usage and
#                    configure periods when they cannot log in.
### END INIT INFO

# Author: Savvas Radevic <vicedar@gmail.com>

. /etc/rc.status
rc_reset

# PATH should only include /usr/* if it runs after the mountnfs.sh script

PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="computer usage control daemon"
NAME=timekpr
DAEMON=/usr/bin/$NAME
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/$NAME/default ] && . /etc/$NAME/default



case "$1" in
  start)
	echo "Starting $DESC" "$NAME"
	/sbin/startproc -l /var/log/timekpr.log $DAEMON
	rc_status -v
	;;
  stop)
	echo "Stopping $DESC" "$NAME"
	/sbin/killproc -TERM $DAEMON
	rc_status -v
	;;
  status)
	echo "Checking $DESC" "$NAME"
	/sbin/checkproc $DAEMON
	rc_status -v
	;;
  #reload|force-reload)
	#
	# If do_reload() is not implemented then leave this commented out
	# and leave 'force-reload' as an alias for 'restart'.
	#
	#log_daemon_msg "Reloading $DESC" "$NAME"
	#do_reload
	#log_end_msg $?
	#;;
  restart|force-reload)
	#
	# If the "reload" option is implemented then remove the
	# 'force-reload' alias
	#
	echo "Restarting $DESC" "$NAME"
	$0 stop
	$0 start
	rc_status
	;;
  *)
	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
	exit 1
	;;
esac
rc_exit