#!/bin/sh

# PROVIDE: turnserver 

# Add the following lines to /etc/rc.conf to enable turnserver:
# turnserver_enable(bool):	Set it to "YES" to enable turnserver.
#				Default is "NO".
# turnserver_pidfile (path):	Set full path to master.pid.
#				Default is "/var/run/turnserver.pid".
# turnserver_flags (str):	Flags passed to the turnserver on startup.
#				Default is "-o".
#

. /etc/rc.subr

name="turnserver"
rcvar="turnserver_enable"

load_rc_config $name

: ${turnserver_enable:="NO"}
: ${turnserver_pidfile:="/var/run/${name}.pid"}
: ${turnserver_flags="-o"}


pidfile=${turnserver_pidfile}
command="/usr/local/bin/turnserver"
command_args="${turnserver_flags}"

run_rc_command "$1"