# mpd
#
# starts mpd

description	"Start Music Player Daemon"
author		"Arjan Bouter <abouter@sourcemage.org>"

start on network-start and alsa-start and syslog-start
stop on shutdown

script
  MPD_DB="$(grep db_file /etc/sysconfig/mpd | cut -d \" -f 2)"
  ARGS="--no-daemon /etc/sysconfig/mpd"
  [[ -z $MPD_DB ]] && ARGS="--create-db $ARGS"
  /usr/bin/mpd $ARGS
end script
