diff options
author | Martin Holzer <mholzer@gentoo.org> | 2003-11-19 17:06:41 +0000 |
---|---|---|
committer | Martin Holzer <mholzer@gentoo.org> | 2003-11-19 17:06:41 +0000 |
commit | c2cea4faf98327f630a506a37965015b5375d8ef (patch) | |
tree | e70861bb5a1290927cc78b878b24c6eae9cc2eed /media-sound/mpd/files | |
parent | more cleanups (diff) | |
download | gentoo-2-c2cea4faf98327f630a506a37965015b5375d8ef.tar.gz gentoo-2-c2cea4faf98327f630a506a37965015b5375d8ef.tar.bz2 gentoo-2-c2cea4faf98327f630a506a37965015b5375d8ef.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 $? +} |