diff options
author | 2003-11-19 17:06:41 +0000 | |
---|---|---|
committer | 2003-11-19 17:06:41 +0000 | |
commit | 5899446b276d42d5f8d252b1ba71cdb58d8a98e6 (patch) | |
tree | 036d70be073337b21f111d6133102fbc197d3ecd /media-sound/mpd/files | |
parent | more cleanups (diff) | |
download | historical-5899446b276d42d5f8d252b1ba71cdb58d8a98e6.tar.gz historical-5899446b276d42d5f8d252b1ba71cdb58d8a98e6.tar.bz2 historical-5899446b276d42d5f8d252b1ba71cdb58d8a98e6.zip |
adding init script.
Diffstat (limited to 'media-sound/mpd/files')
-rw-r--r-- | media-sound/mpd/files/mpd.conf | 8 | ||||
-rw-r--r-- | media-sound/mpd/files/mpd.rc6 | 42 |
2 files changed, 50 insertions, 0 deletions
diff --git a/media-sound/mpd/files/mpd.conf b/media-sound/mpd/files/mpd.conf new file mode 100644 index 000000000000..a82bb1c6332c --- /dev/null +++ b/media-sound/mpd/files/mpd.conf @@ -0,0 +1,8 @@ +#CONFIG-FILE for /etc/init.d/mpd + +# the required parameters +PORT="2100" +MUSIC_DIR="" +PLAYLIST_DIR="" +LOG_FILE="/var/log/mpd.log" +ERROR_FILE="/var/log/mpd.error" diff --git a/media-sound/mpd/files/mpd.rc6 b/media-sound/mpd/files/mpd.rc6 new file mode 100644 index 000000000000..f9e0983ad364 --- /dev/null +++ b/media-sound/mpd/files/mpd.rc6 @@ -0,0 +1,42 @@ +#!/sbin/runscript +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: + +depend() { + need localmount +} + +checkconfig() { + if [ -z "$PORT" ] || \ + [ -z "$MUSIC_DIR" ] || \ + [ -z "$PLAYLIST_DIR" ] || \ + [ -z "$LOG_FILE" ] || \ + [ -z "$ERROR_FILE" ] + then + eerror "You need to set PORT, MUSIC_DIR, PLAYLIST_DIR," + eerror " LOG_FILE and ERROR_FILE in /etc/conf.d/mpd" + return 1 + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting Music Player Daemon" + + /usr/bin/mpd ${PORT} \ + ${MUSIC_DIR} \ + ${PLAYLIST_DIR} \ + ${LOG_FILE} \ + ${ERROR_FILE} + + eend $? +} + +stop() { + ebegin "Stopping Music Player Daemon" + + killall mpd &>/dev/null + + eend $? +} |