#!/bin/sh

# $FreeBSD: ports/net/mediaproxy/files/mediaproxy.in,v 1.2 2012/01/14 08:56:18 dougb Exp $
#
# PROVIDE: mediaproxy
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# mediaproxy   starts and stops the SER MediaProxy server
#
# Add the following line to /etc/rc.conf to enable mediaproxy:
# mediaproxy_enable (bool):	Set to "NO" by default.
#				Set it to "YES" to enable mediaproxy.
#
# mediaproxy_flags (string):	Set command line options

. /etc/rc.subr

name="mediaproxy"
rcvar=mediaproxy_enable

load_rc_config $name

: ${mediaproxy_enable="NO"}

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

command="/usr/local/mediaproxy/mediaproxy.py"
command_interpreter="/usr/local/bin/python2.7"
command_args="--pid $pidfile"

start_postcmd="/usr/local/etc/rc.d/proxydispatcher onestart"
stop_postcmd="/usr/local/etc/rc.d/proxydispatcher stop"

run_rc_command "$1"
