#! /bin/sh 
#
# bnetd         Script to control the Unix Battle.net Daemon
#
# chkconfig: 2345 99 7
# description: bnetd is a Unix clone of the Battle.net Daemon
#
### BEGIN INIT INFO
# Provides: pvpgn
# Default-Start: 2 3 4 5
# Required-Start: $network
# Required-Stop: $network
# Should-Start: mysqld postgresql
# Should-Stop: mysqld postgresql
# Short-Description: Battle.net games-server
# Description: bnetd is a Unix clone of the Battle.net Daemon
### END INIT INFO

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

# See how we were called.
case "$1" in
  start)
        # Start daemons.
        gprintf "Starting bnetd: "
        daemon bnetd
        echo
        touch /var/lock/subsys/bnetd
        ;;

  stop)
        # Stop daemons.
        gprintf "Shutting down bnetd: "
	killproc bnetd
        echo
        rm -f /var/lock/subsys/bnetd
        ;;

  reload)
	$0 stop
	$0 start
	;;

  restart)
	$0 stop
	$0 start
	;;

  status)
	status bnetd
	;;

  *)
        gprintf "Usage: bnetd {start|stop|restart|reload|status}\n"
        exit 1
esac

exit 0
