[package] start mpd normally, patch from Stefan Monnier

git-svn-id: svn://svn.openwrt.org/openwrt/packages@20318 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2010-03-20 12:13:01 +00:00
parent 0a57a8a116
commit dcbcaae8e0
2 changed files with 10 additions and 16 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=mpd PKG_NAME:=mpd
PKG_VERSION:=0.15.8 PKG_VERSION:=0.15.8
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/musicpd PKG_SOURCE_URL:=@SF/musicpd

View File

@ -4,27 +4,21 @@ START=93
start() { start() {
#create mpd directories #create mpd directories
md=`grep music_directory /etc/mpd.conf | cut -d "\"" -f 2 | sed "s/~/\/root/g"`
if [ ! -d $md ]; then
mkdir -p $md
fi
pld=`grep playlist_directory /etc/mpd.conf | cut -d "\"" -f 2 | sed "s/~/\/root/g"` pld=`grep playlist_directory /etc/mpd.conf | cut -d "\"" -f 2 | sed "s/~/\/root/g"`
if [ ! -d $pld ]; then if [ ! -d $pld ]; then
mkdir -p $pld mkdir -p $pld
fi fi
#create mpd db # Set the initial volume to something manageable
/usr/bin/mpd --stdout --create-db amixer set PCM 40
#optional export for mpc
#export MPD_HOST=127.0.0.1
#start mpd #start mpd
/usr/bin/mpd if [ -x /bin/nice ]; then
# This has real-time constraints, so let's at least tell the OS
#generate playlist and start to play # that this should have higher priority to avoid skipping
/usr/bin/mpc listall | /usr/bin/mpc add - # when doing other things in the background.
/usr/bin/mpc play nice="nice -n -10"
/usr/bin/mpc repeat fi
$nice /usr/bin/mpd
} }
stop() { stop() {