Lines 2-29
Link Here
|
2 |
# |
2 |
# |
3 |
# $FreeBSD$ |
3 |
# $FreeBSD$ |
4 |
# |
4 |
# |
5 |
|
|
|
6 |
# |
7 |
# PROVIDE: turnserver |
5 |
# PROVIDE: turnserver |
8 |
# REQUIRE: DAEMON |
6 |
# REQUIRE: DAEMON |
9 |
# BEFORE: mail |
7 |
# BEFORE: mail |
10 |
# KEYWORD: shutdown |
8 |
# KEYWORD: shutdown |
11 |
# |
|
|
12 |
|
9 |
|
13 |
. /etc/rc.subr |
10 |
. /etc/rc.subr |
14 |
|
11 |
|
15 |
name="turnserver" |
12 |
name=turnserver |
16 |
rcvar="${name}_enable" |
13 |
rcvar=turnserver_enable |
17 |
command="%%PREFIX%%/bin/${name}" |
14 |
desc=TURN and STUN server |
18 |
pidfile="/var/run/${name}.pid" |
|
|
19 |
required_files="%%PREFIX%%/etc/${name}.conf" |
20 |
|
15 |
|
21 |
load_rc_config ${name} |
16 |
load_rc_config ${name} |
22 |
|
17 |
|
23 |
: ${turnserver_enable="NO"} |
18 |
: ${turnserver_enable:=NO} |
24 |
: ${turnserver_flags="-o"} |
|
|
25 |
: ${turnserver_configfile:=%%PREFIX%%/etc/$name.conf} |
19 |
: ${turnserver_configfile:=%%PREFIX%%/etc/$name.conf} |
26 |
|
20 |
|
27 |
command_args="-c ${turnserver_configfile} ${turnserver_flags}" |
21 |
command="%%PREFIX%%/bin/${name}" |
|
|
22 |
required_files="%%PREFIX%%/etc/${name}.conf" |
23 |
start_precmd=find_pidfile |
24 |
stop_precmd=find_pidfile |
25 |
status_precmd=find_pidfile |
26 |
command_args="-o -c ${turnserver_configfile}" |
28 |
|
27 |
|
|
|
28 |
find_pidfile() |
29 |
{ |
30 |
if get_pidfile_from_conf pidfile $turnserver_configfile; then |
31 |
pidfile="$_pidfile_from_conf" |
32 |
else |
33 |
pidfile="/var/run/${name}.pid" |
34 |
fi |
35 |
} |
36 |
|
29 |
run_rc_command "$1" |
37 |
run_rc_command "$1" |