summaryrefslogtreecommitdiff
path: root/net/ccxstream/files/ccxstream.in
blob: fc14da47256f18ddae1d2272ffe0930eeb26226c (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
46
47
48
49
#!/bin/sh

# PROVIDE: ccxstream
# REQUIRE: DAEMON

# Define these ccxstream_* variables in one of these files:
#       /etc/rc.conf
#       /etc/rc.conf.local
#       /etc/rc.conf.d/ccxstream
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE!
# 
# The port will refuse to start unless ccxstream_flags is initalized,
# in addition to ccxstream_enable. For information on the arguments
# to ccxstream, look at %%PREFIX%%/share/doc/ccxstream/README (if you
# installed the port documentation by not specifying WITHOUT=DOCS) or the
# output of "ccxstream -h". At bare minimum, you'll want to add the
# "-u <user>" argument to specify the userid the server will run under
# (unless you WANT to run this code as root), and the "-r <directory>"
# argument to configure the directory root that the server will share
# from.
# 
# Don't worry about the "-f" (background) and "-F <pidfile>" arguments;
# this script takes care of them for you.

. /etc/rc.subr

name="ccxstream"
rcvar=ccxstream_enable

command="%%PREFIX%%/sbin/ccxstream"

load_rc_config "$name"
: ${ccxstream_enable="NO"}
: ${ccxstream_flags="DEFAULT"}

pidfile=${ccxstream_pidfile="/var/run/${name}.pid"}

command_args="-f -F ${pidfile}"

ccxstream_precmd () {
	if [ x"${ccxstream_flags}" = xDEFAULT ]; then
		warn must set ccxstream_flags first, no acceptable defaults
		return 1
	fi
	return 0
}

run_rc_command "$1"