#!/bin/sh
########################################################################
# Begin $rc_base/init.d/applejuice
#
# Description : Applejuice Init script
#
# Authors     : Michael Tremer - www.ipfire.org
#
# Version     : 01.00
#
# Notes       :
#
########################################################################

. /etc/sysconfig/rc
. ${rc_functions}
eval $(/usr/local/bin/readhash /var/ipfire/applejuice/settings)


case "${1}" in
	start)
		boot_mesg "Starting Applejuice Core..."
		cd /opt/applejuice
		screen -dmS ajcore /usr/bin/java -Xmx${RAMSIZE} -Djava.library.path=. -jar ajcore.jar
		evaluate_retval
		;;

	stop)
		boot_mesg "Stopping Applejuice Core..."
		killproc /usr/bin/java
		;;

	restart)
		${0} stop
		sleep 1
		${0} start
		;;

	status)
		statusproc /usr/bin/java
		;;
		
	core)
		screen -x ajcore
		;;

	*)
		echo "Usage: ${0} {start|stop|restart|status|core}"
		exit 1
		;;
esac

# End $rc_base/init.d/applejuice
