#!/bin/sh
### BEGIN INIT INFO
# Provides: ympd
-# Required-Start: $local_fs $mpd
-# Required-Stop: $local_fs $mpd
+# Required-Start: $remote_fs mpd
+# Required-Stop: $remote_fs mpd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Daemonized version of ympd.
SCRIPTNAME=/etc/init.d/$NAME
LOG_OUT=/var/log/$NAME.out
LOG_ERR=/var/log/$NAME.err
-YMPD_USER=mpd
-DAEMON_OPT="--user $YMPD_USER --webport 8080"
+YMPD_USER=nobody
+MPD_HOST=localhost
+MPD_PORT=6600
+WEB_PORT=8080
+
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Load the VERBOSE setting and other rcS variables
[ -f /etc/default/rcS ] && . /etc/default/rcS
+DAEMON_OPT="--user $YMPD_USER --webport $MPD_WEBHOST --host $MPD_HOST --port $MPD_PORT"
+
do_start()
{
start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile \
Environment=MPD_HOST=localhost
Environment=MPD_PORT=6600
Environment=WEB_PORT=8080
-EnvironmentFile=-/etc/conf.d/ympd
-ExecStart=/usr/bin/ympd -h $MPD_HOST -p $MPD_PORT -w $WEB_PORT
+Environment=YMPD_USER=nobody
+EnvironmentFile=/etc/default/ympd
+ExecStart=/usr/bin/ympd --user $YMPD_USER --webport $MPD_WEBHOST --host $MPD_HOST --port $MPD_PORT
Type=simple
[Install]