packages/sound/mpd/files/mpd.init

27 lines
556 B
Text
Raw Normal View History

2014-07-16 16:31:58 +00:00
#!/bin/sh /etc/rc.common
# Copyright (C) 2007-2014 OpenWrt.org
2014-07-16 16:31:58 +00:00
START=93
USE_PROCD=1
2014-07-16 16:31:58 +00:00
PROG=/usr/bin/mpd
CONFIGFILE=/etc/mpd.conf
NICEPRIO=-10
2014-07-16 16:31:58 +00:00
#TODO: Add uci config - nice, config
2014-07-16 16:31:58 +00:00
start_service() {
#create mpd directories from config
local pld=`grep ^playlist_directory "$CONFIGFILE" | cut -d "\"" -f 2 | sed "s/~/\/root/g"`
if [ ! -d $pld ]; then
mkdir -m 0755 -p $pld
fi
2014-07-16 16:31:58 +00:00
procd_open_instance
procd_set_param command "$PROG" --no-daemon "$CONFIGFILE"
# Give MPD some real-time priority
procd_set_param nice "$NICEPRIO"
procd_close_instance
2014-07-16 16:31:58 +00:00
}