diff options
author | Azat Bahawi <azat@bahawi.net> | 1970-01-01 03:00:00 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2022-09-20 11:52:14 +0300 |
commit | 12e5779dd038b593f0ff947a54c3b54bf0e8c183 (patch) | |
tree | 6fcd154745b1956e4a0aa1f9e976d0ddebde1c86 /media-sound/mpdscribble/files |
Diffstat (limited to 'media-sound/mpdscribble/files')
-rwxr-xr-x | media-sound/mpdscribble/files/mpdscribble | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/media-sound/mpdscribble/files/mpdscribble b/media-sound/mpdscribble/files/mpdscribble new file mode 100755 index 0000000..d23ebd1 --- /dev/null +++ b/media-sound/mpdscribble/files/mpdscribble @@ -0,0 +1,32 @@ +#!/sbin/openrc-run +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +: CFGFILE=${CFGFILE:=/etc/mpdscribble.conf} + +get_config() { + x=$1 + test -e ${CFGFILE} || return 1 + cat ${CFGFILE} | \ + sed -n -e '/^[ \t]*'${x}'/{s:^[ \t]*'${x}'[ \t]\+"\?\([^#"]\+\)[^"]*"\?$:\1: ; p }' | \ + awk '{print $3}' +} + +extra_started_commands='reload' +command=/usr/bin/mpdscribble +#command_args="--conf ${CFGFILE}" +required_files=${CFGFILE} +pidfile=$(get_config pid) +description="An MPD client that submits information to Audioscrobbler" + +depend() { + need mpd + use net + config ${CFGFILE} +} + +reload() { + ebegin "Reloading ${RC_SVCNAME}" + start-stop-daemon --pidfile ${pidfile} --signal HUP + eend $? +} |