#!/bin/sh
# $Id: oar-server.init.d,v 1.3 2005/06/08 14:11:34 capitn Exp $
#
# oarserver:       Starts the oarserver Daemon
#
# Version:      0.1
#
# chkconfig: 345  99 01
# description: This is the OAR server
# processname: oar-server
# config: /etc/oar.conf
# Source function library.
. /etc/rc.d/init.d/functions

# See how we were called.


if [ ! -f /etc/oar.conf ]; then
    gprintf "Can't find /etc/oar.conf\n"
    exit 0
fi

case "$1" in
  start)
		daemon /usr/sbin/oar-server 
		RETVAL=$?
		echo
		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/oar-server
    echo
    ;;
  stop)
		killproc oar-server
    echo
    ;;
  restart|reload)
                $0 stop
                sleep 1
                $0 start
                ;;
  status)
        status oar-server
	;;
  *)
    gprintf "*** Usage: oar {start|restart|stop}\n"
    exit 1
esac

exit $RETVAL

