Added
Link Here
|
1 |
#!/bin/sh |
2 |
# |
3 |
# $FreeBSD: ports/www/resin3/files/resin3.sh.in,v 1.1 2012/03/13 16:29:23 jgh Exp $ |
4 |
# |
5 |
|
6 |
# PROVIDE: %%APP_NAME%% |
7 |
# REQUIRE: LOGIN NETWORKING SERVERS |
8 |
# BEFORE: DAEMON |
9 |
# KEYWORD: shutdown |
10 |
|
11 |
# |
12 |
# Add the following line to /etc/rc.conf to enable %%APP_NAME%%: |
13 |
# |
14 |
# %%APP_NAME%%_enable="YES" |
15 |
# |
16 |
|
17 |
|
18 |
%%APP_NAME%%_enable=${%%APP_NAME%%_enable:-"NO"} |
19 |
%%APP_NAME%%_user=${%%APP_NAME%%_user:-"%%USERS%%"} |
20 |
%%APP_NAME%%_group=${%%APP_NAME%%_group:-"%%GROUPS%%"} |
21 |
|
22 |
. /etc/rc.subr |
23 |
|
24 |
name=%%APP_NAME%% |
25 |
rcvar=%%APP_NAME%%_enable |
26 |
|
27 |
load_rc_config ${name} |
28 |
|
29 |
command="%%PREFIX%%/sbin/%%APP_NAME%%ctl" |
30 |
command_args="start" |
31 |
pidfile=%%PID_FILE%% |
32 |
|
33 |
if test -n "${%%APP_NAME%%_java_version}" ; then |
34 |
JAVA_HOME=$(JAVA_VERSION="${%%APP_NAME%%_java_version}" JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVA_HOME | cut -d= -f2) |
35 |
procname=$(JAVA_VERSION="${%%APP_NAME%%_java_version}" JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -d= -f2) |
36 |
else |
37 |
JAVA_HOME=$(JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVA_HOME | cut -d= -f2) |
38 |
procname=$(JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -d= -f2) |
39 |
fi |
40 |
|
41 |
export JAVA_HOME |
42 |
|
43 |
run_rc_command "$1" |