#!/bin/sh
#
# $FreeBSD: ports/audio/icecast2/files/icecast2.sh.in,v 1.4 2006/08/03 20:39:08 erwin Exp $
#

# PROVIDE: icecast2
# REQUIRE: DAEMON
# BEFORE:  login
# KEYWORD: shutdown

# Add the following line to /etc/rc.conf to enable `icecast2'. This requires
# a working configuration in /usr/local/etc/icecast.xml.
#
#icecast_enable="YES"
#
# Make sure the <changeowner> section in your /usr/local/etc/icecast.xml is
# not commented out - icecast refuses to run as root.
#

. "/etc/rc.subr"

name="icecast"
rcvar=`set_rcvar`

command="/usr/local/bin/icecast"
command_args="-b 1>/dev/null"
required_files="/usr/local/etc/$name.xml"

# read configuration and set defaults
load_rc_config "$name"
: ${icecast_enable="NO"}
: ${icecast_flags="-c ${required_files}"}

run_rc_command "$1"
