#!/bin/sh
################################################################################
#	Boapns	This shell script takes care of starting and stopping
#			the Boapns daemon
#
# chkconfig: 2345 20 80
# description: Boapns is the startup for Boapns server daemons
# processname: boapns

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

if [ -e /usr/tms/bin/boapns ]; then
	BOAPNS=/usr/tms/bin/boapns
elif [ -e /usr/bds/bin/boapns ]; then
	BOAPNS=/usr/bds/bin/boapns
else
	BOAPNS=/usr/bin/boapns
fi

# See how we were called.
case "$1" in
  start)
        # Start daemons.
        echo -n "Starting Boapns System:"
	daemon --user=daemon ${BOAPNS}
        echo
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down Boapns System"
	killproc ${BOAPNS}
        echo
        ;;
  status)
	status ${BOAPNS}
	;;
  restart|reload)
	$0 stop
	$0 start
	;;
  *)
        echo "Usage: boapns {start|stop|restart|reload|status}"
        exit 1
esac

exit 0
