#!/bin/sh # /etc/rc.d/rc.mpd # Start/stop/restart the Music Player Daemon (MPD) mpd_start() { if [ -x /usr/bin/mpd ]; then echo "Starting MPD: /usr/bin/mpd" /usr/bin/mpd /etc/mpd.conf fi } mpd_stop() { echo "Stopping MPD..." /usr/bin/mpd --kill } mpd_restart() { mpd_stop sleep 1 mpd_start } case "$1" in 'start') mpd_start ;; 'stop') mpd_stop ;; 'restart') mpd_restart ;; *) echo "usage $0 start|stop|restart" esac