#!/bin/sh
# put this startup script to /etc/init.d,
# and then do "update-rc.d"

# start and stop IIIM server

HTT="/usr/lib/im/htt"
OPTIONS=""

# check servers.
test -x $HTT || exit 0

case "$1" in
    start)
	echo -n "Start IIIM server"
	start-stop-daemon -b --start --quiet --exec ${HTT}
	echo "."
	;;

    stop)
	echo -n "Stop IIIM server"
	start-stop-daemon --stop --quiet --exec ${HTT}
	echo "."
	;;

    restart)
	echo -n "Restart IIIM server"
	start-stop-daemon --stop --quiet --exec ${HTT}
	sleep 10
	start-stop-daemon -b --start --quiet --exec ${HTT}
	echo "."
	;;
    *)
	echo "Usage: $0 { start | stop }"
	exit 1
	;;
esac
exit 0
