freebsd-ports/www/resin3/files/resin.sh.in
Herve Quiroz 1288c2e076 - Update to 3.0.20
- A new option can be set in rc.conf to specify Java version to be used:
  resin3_java_version
- Change maintainer address

PR:		101648
Submitted by:	maintainer
2006-08-09 21:18:10 +00:00

43 lines
1 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: %%APP_NAME%%
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable %%APP_NAME%%:
#
# %%APP_NAME%%_enable="YES"
#
. /etc/rc.subr
name=%%APP_NAME%%
rcvar=`set_rcvar`
command=%%PREFIX%%/sbin/%%APP_NAME%%ctl
command_args="$1"
pidfile=%%PID_FILE%%
# set defaults
%%APP_NAME%%_enable=${%%APP_NAME%%_enable:-"NO"}
%%APP_NAME%%_user=${%%APP_NAME%%_user:-"www"}
%%APP_NAME%%_group=${%%APP_NAME%%_group:-"www"}
load_rc_config ${name}
if test -n "${%%APP_NAME%%_java_version}" ; then
JAVA_HOME=$(JAVA_VERSION="${%%APP_NAME%%_java_version}" JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVA_HOME | cut -d= -f2)
procname=$(JAVA_VERSION="${%%APP_NAME%%_java_version}" JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -d= -f2)
else
JAVA_HOME=$(JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVA_HOME | cut -d= -f2)
procname=$(JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -d= -f2)
fi
export JAVA_HOME
run_rc_command "$1"