#!/bin/sh

PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=lwresd
DAEMON=/usr/sbin/lwresd

test -x $DAEMON || exit 0

case "$1" in
    start)
	echo -n "Starting domain name service: $NAME"
	start-stop-daemon --start --quiet --exec $DAEMON 
	echo "."	
    ;;

    stop)
	echo -n "Stopping domain name service: $NAME"
	start-stop-daemon --stop --quiet  \
	    --pidfile /var/run/$NAME.pid --exec $DAEMON
	echo "."	
    ;;

    restart|force-reload)
	$0 stop
	sleep 2
	$0 start
    ;;
    
    *)
	echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2
	exit 1
    ;;
esac

exit 0
