#!/bin/sh
#
# IIim		Start and stop IIIM server
#
# chkconfig: 2345 87 17
# description: a major component of IIIMSF.

# Source function library.
. /etc/init.d/functions

HTT="/usr/lib/im/htt"
LOCKER="/var/lock/subsys/htt"
OPTIONS=""
RETVAL=0

test -x $HTT || exit 0

start() {
        echo -n $"Starting $HTT: "
        daemon $HTT $OPTIONS &
        echo
	RETVAL=$?
	[ $RETVAL -eq 0 ] && touch $LOCKER
}

stop() {
        echo -n "Stopping $HTT: "
	killproc htt
	echo
	RETVAL=$?
	[ $RETVAL -eq 0 ] && rm -f $LOCKER
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  status)
        status htt
        ;;
  restart|reload)
        stop
        start
        ;;
  condrestart)
        if [ -f /var/lock/subsys/htt ]; then
            stop
            start
        fi
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart|condrestart|status}"
        exit 1
esac

exit $RETVAL
