#!/bin/sh
# minidlna only supports foregrounding in debug mode, and we don't want a flood
# in our logs. so no runit for this one, instead, daemonize.

minidlna_start()
{
  echo "Start minidlna."
  /bin/minidlnad
}

minidlna_stop()
{
  echo "Stopping minidlna"
  killall minidlnad
}

minidlna_restart()
{
  minidlna_stop
  sleep 2 
  minidlna_start
}

case $1 in
'start')
  minidlna_start
  ;;
'stop')
  minidlna_stop
  ;;
'restart')
  minidlna_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac

