blob: c0eaf4dc113f92b6b91f5216a734525037af34cd (
plain)
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
|
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: turnserver
# REQUIRE: DAEMON
# BEFORE: mail
# KEYWORD: shutdown
. /etc/rc.subr
name=turnserver
rcvar=turnserver_enable
desc=TURN and STUN server
load_rc_config ${name}
: ${turnserver_enable:="NO"}
: ${turnserver_configfile:=%%PREFIX%%/etc/$name.conf}
command="%%PREFIX%%/bin/${name}"
required_files="%%PREFIX%%/etc/${name}.conf"
start_precmd=find_pidfile
stop_precmd=find_pidfile
status_precmd=find_pidfile
command_args="-o -c ${turnserver_configfile}"
find_pidfile()
{
if get_pidfile_from_conf pidfile $turnserver_configfile; then
pidfile="$_pidfile_from_conf"
else
pidfile="/var/run/${name}.pid"
fi
}
run_rc_command "$1"
|