blob: 3eb0bc2bcb82c78ba9ca1bcbe14c3c3f3dd4e79a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#!/sbin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
: CFGFILE=${CFGFILE:=/etc/mpd.conf}
depend() {
need localmount
use net netmount nfsmount alsasound esound pulseaudio
config ${CFGFILE}
}
get_config() {
x=$1
test -e ${CFGFILE} || return 1
sed -n \
-e '/^[ \t]*'${x}'/{s:^[ \t]*'${x}'[ \t]\+"\?\([^#"]\+\)[^"]*"\?$:\1: ; p }' \
${CFGFILE}
}
extra_started_commands='reload'
command=/usr/bin/mpd
command_args=${opts:=${CFGFILE}}
required_files=${CFGFILE}
pidfile=$(get_config pid_file)
description="Music Player Daemon"
reload() {
ebegin "Reloading ${SVCNAME}"
kill -HUP `cat ${pidfile}`
eend $?
}
|