about summary refs log tree commit diff
path: root/media-sound/mpdscribble/files
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>1970-01-01 03:00:00 +0300
committerAzat Bahawi <azat@bahawi.net>2022-09-20 11:52:14 +0300
commit12e5779dd038b593f0ff947a54c3b54bf0e8c183 (patch)
tree6fcd154745b1956e4a0aa1f9e976d0ddebde1c86 /media-sound/mpdscribble/files
chore: init HEAD master
Diffstat (limited to '')
-rwxr-xr-xmedia-sound/mpdscribble/files/mpdscribble32
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 $?
+}

Consider giving Nix/NixOS a try! <3