packages/sound/mpd/files/mpd.init
florian dcbcaae8e0 [package] start mpd normally, patch from Stefan Monnier
git-svn-id: svn://svn.openwrt.org/openwrt/packages@20318 3c298f89-4303-0410-b956-a3cf2f4a3e73
2010-03-20 12:13:01 +00:00

27 lines
593 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org
START=93
start() {
#create mpd directories
pld=`grep playlist_directory /etc/mpd.conf | cut -d "\"" -f 2 | sed "s/~/\/root/g"`
if [ ! -d $pld ]; then
mkdir -p $pld
fi
# Set the initial volume to something manageable
amixer set PCM 40
#start mpd
if [ -x /bin/nice ]; then
# This has real-time constraints, so let's at least tell the OS
# that this should have higher priority to avoid skipping
# when doing other things in the background.
nice="nice -n -10"
fi
$nice /usr/bin/mpd
}
stop() {
killall mpd
}