#!/bin/sh
# $Id: init.d-kinkd.in,v 1.1 2005/02/04 05:12:56 sakane Exp $
# kinkd start up script
#

prefix=/usr/pkg
exec_prefix=${prefix}

NAME=kinkd
DAEMON=${exec_prefix}/sbin/$NAME
PIDFILE=/var/run/$NAME.pid

test -x $DAEMON || exit 0

set -e

case "$1" in
start)
	echo -n "Starting $NAME"
	$DAEMON
	echo "."
	;;
stop)
	echo -n "Stopping $NAME"
	read pid junk < $PIDFILE && kill $pid
	echo "."
	;;
restart)
	$0 stop
	$0 start
	;;
reload)
	echo -n "Reloading $NAME"
	read pid junk < $PIDFILE && kill -HUP $pid
	echo "."
	;;
*)
	echo "usage: $0 {start|stop|restart|reload}"
	exit 1
	;;
esac

exit 0
