#!/bin/sh
#
# php-java-bridge      Startup script for the PHP/Java Bridge
#
# chkconfig: - 84 16
# description: The PHP/Java Bridge allows PHP scripts to access java based \
#                        applications running in a java application server 
# processname: php-java-bridge
# pidfile: /var/run/php-java-bridge.pid
# config: /etc/php.d/java.ini

prog=php-java-bridge
RETVAL=0

# Source function library.
if test -f /etc/rc.d/init.d/functions; then
. /etc/rc.d/init.d/functions
else
killproc() {
 kill `cat /var/run/php-java-bridge.pid`
}
fi

start() {
        echo -n $"Starting $prog: "
        daemon $prog
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && test -d /var/lock/subsys && touch /var/lock/subsys/$prog
        return $RETVAL
}
stop() {
	echo -n $"Stopping $prog: "
	killproc $prog
	RETVAL=$?
	echo
	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog /var/run/$prog.pid
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
        status $prog
	RETVAL=$?
	;;
  restart)
	stop
	start
	;;
  faststart)
        start
	;;
  *)
	echo $"Usage: $prog {faststart|start|stop|restart|status}"
	exit 1
esac

exit $RETVAL
