From 12e5779dd038b593f0ff947a54c3b54bf0e8c183 Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Thu, 1 Jan 1970 03:00:00 +0300 Subject: chore: init --- media-sound/mpdscribble/files/mpdscribble | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 media-sound/mpdscribble/files/mpdscribble (limited to 'media-sound/mpdscribble/files') 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 $? +} -- cgit 1.4.1