aboutsummaryrefslogtreecommitdiff
path: root/www/cherokee-devel/files/cherokee.sh.in
blob: 098daf69297e436d2bfd6ccb40bbeb71b632d215 (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
39
40
41
42
43
44
45
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: cherokee
# REQUIRE: %%REQUIRE%%
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable cherokee:
#
# cherokee_enable (bool):	Set it to "YES" to enable cherokee
#				Default is "NO".
# cherokee_conf (path):		Set full path to config file.
#				Default is "%%PREFIX%%/etc/cherokee/cherokee.conf".
#

. %%RC_SUBR%%

name="cherokee"
rcvar=`set_rcvar`

load_rc_config $name

: ${cherokee_enable="NO"}
: ${cherokee_conf="%%PREFIX%%/etc/cherokee/cherokee.conf"}

command=%%PREFIX%%/sbin/cherokee
command_args="-C ${cherokee_conf} -b"
pidfile=/var/run/cherokee.pid
required_files=${cherokee_conf}
stop_postcmd=stop_postcmd
restart_precmd="checkconfig"

checkconfig()
{
	echo "Performing sanity check on ${name} configuration:"
	eval "${command} ${command_args} -t"
}

stop_postcmd()
{
	rm -f ${pidfile}
}

run_rc_command "$1"