#! /bin/sh


case "$1" in

    start)
	/sbin/getcfg upnp_mms_enable
	if [ "$?" != "1" ]; then
		echo "UPNP Media Server off"
		exit 0
	fi
	
	upnp_mms&
	echo "UPNP Media Server On"
	;;

    stop)
	killall -9 upnp_mms 
	if [ "$?" = "0" ]; then 
		echo "Done"
	else    
		echo "FAILED"; 
	fi
	;;

    restart)
    	$0 stop
	sleep 1
	$0 start
	;;

    *)
	echo "Usage: $0 (start|stop|restart)"
	exit 1
	;;

esac

exit 0

