aboutsummaryrefslogtreecommitdiff
path: root/www/helma/files/helma.in
blob: bb1d5211336f3899d51109eeb9ec76bdc6538b25 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

# PROVIDE: helma
# REQUIRE: DAEMON
# BEFORE:  LOGIN
#
# Add the following line to /etc/rc.conf[.local] to enable helma
#
# helma_enable (bool):          Set to "NO" by default.
#                               Set it to "YES" to enable helma.
# helma_config (str):           Custom config file for helma.
#                               (default %%PREFIX%%/etc/helma/helma.conf)

. /etc/rc.subr

name="helma"
rcvar=`set_rcvar`
pidfile="/var/run/${name}.pid"

load_rc_config $name

# set default
: ${helma_enable="NO"}
: ${helma_config="%%PREFIX%%/etc/${name}/${name}.conf"}

start_cmd="%%PREFIX%%/bin/${name} ${helma_config}"

# Check for existence of needed config file
if [ ! -r ${helma_config} ]; then
    echo "Can't read config file ${helma_config}"
    exit 1
else
    . ${helma_config}
fi

command="$JAVA_BIN"

run_rc_command "$1"