#!/bin/sh
########################################################################
# Begin $rc_base/init.d/
#
# Description : mediatomb initscript
#
# Authors     : Arne Fitzenreiter
#
# Version     : 01.00
#
# Notes       : for www.ipfire.org - GPLv3
#
########################################################################

. /etc/sysconfig/rc
. ${rc_functions}

case "$1" in
	start)
		boot_mesg "Starting mediatomb uPnP Mediaserver..."
		route add -net 239.0.0.0 netmask 255.0.0.0 green0	
		loadproc /usr/bin/mediatomb -u nobody -g nobody \
			-c /var/ipfire/mediatomb/config.xml \
			-l /var/log/mediatomb.log \
		        -e green0 $2 $3 $4 $5 $6 $7 -d
		evaluate_retval
		;;
		

	stop)
		boot_mesg "Stopping mediatomb uPnP Mediaserver..."
		killproc /usr/bin/mediatomb
		evaluate_retval
		route del -net 239.0.0.0 netmask 255.0.0.0 green0
		;;

	restart)
		${0} stop
		sleep 1
		${0} start

		;;
	status)
		statusproc /usr/bin/mediatomb
		;;

	*)
		echo "Usage: ${0} {start|stop|init|status}"
		exit 1
		;;
esac

# End $rc_base/init.d/
