summaryrefslogtreecommitdiff
path: root/comms/conserver/files/conserver.sh.in
blob: 3c4cc86c37eebc6760afa134be37faa1d8b92335 (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
#!/bin/sh

# $FreeBSD$

# PROVIDE: conserver
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown

# To enable conserver, add lines like below to /etc/rc.conf.
#
# conserver_enable="YES"

if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
    # echo "$0: Cannot determine the PREFIX" >&2
    # exit 1
fi

conserver_enable=${conserver_enable:-"no"}
conserver_configfile=${conserver_configfile:-"${PREFIX}/etc/conserver.cf"}

. /etc/rc.subr

name=conserver
rcvar=`set_rcvar`

command=${PREFIX}/sbin/conserver
command_args="-d -n -C ${conserver_configfile}"

load_rc_config $name

case "$1" in
start)	if [ -x ${command} -a -f ${configfile} ]; then
		run_rc_command "$1"
	fi
	;;
*)
	run_rc_command "$1"
	;;
esac

exit 0