summaryrefslogtreecommitdiff
path: root/www/c-icap/files/c-icap.in
blob: 953cc2fc0c799b4b5ff352db3cbbc25c1c68c1b8 (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
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: c-icap
# REQUIRE: DAEMON cleanvar
# BEFORE: LOGIN

#
# Add the following lines to /etc/rc.conf to enable c-icap:
#
# c_icap_enable="YES"
# c_icap_flags="<set as needed>"
#
# See '%%PREFIX%%/bin/c-icap --help' for flags
#

. /etc/rc.subr

name=c_icap
rcvar=c_icap_enable

command="%%PREFIX%%/bin/c-icap"

stop_postcmd="rm -f $pidfile"

# read settings, set default values
load_rc_config "$name"
: ${c_icap_enable="NO"}
: ${c_icap_conf="%%PREFIX%%/etc/c-icap/c-icap.conf"}
: ${c_icap_pidfile="%%RUN_DIR%%/c-icap.pid"}
: ${c_icap_user="%%CICAP_USER%%"}

pidfile="${c_icap_pidfile}"
required_files="${c_icap_conf}"
command_args="-f ${c_icap_conf}"
stop_postcmd=stop_postcmd

stop_postcmd() {
	rm -f %%RUN_DIR%%/c-icap.ctl
}

run_rc_command "$1"