diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-misc/samplicator/files/samplicator.initd |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-misc/samplicator/files/samplicator.initd')
-rw-r--r-- | net-misc/samplicator/files/samplicator.initd | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/net-misc/samplicator/files/samplicator.initd b/net-misc/samplicator/files/samplicator.initd new file mode 100644 index 000000000000..0260192c3ee1 --- /dev/null +++ b/net-misc/samplicator/files/samplicator.initd @@ -0,0 +1,39 @@ +#!/sbin/openrc-run +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +NAME=${SVCNAME##*.} +if [ -n "${NAME}" -a "${SVCNAME}" != "samplicator" ]; then + PID="/run/samplicator.${NAME}.pid" + PNAME=$(echo ${RC_SVCNAME} | sed 's/\..*//g') + CONF_DEFAULT="/etc/conf.d/samplicator.${NAME}" +else + PID="/run/samplicator.pid" + PNAME=${RC_SVCNAME} + CONF_DEFAULT="/etc/conf.d/samplicator" +fi +CONF=${CONF:-${CONF_DEFAULT}} +EXEC=${EXEC:-/usr/bin/samplicate} + +depend() { + need net + provide samplicator +} + +start() { + ebegin "Starting samplicator" + start-stop-daemon --start --quiet --background --make-pidfile --pidfile ${PID} --exec ${EXEC} -- ${OPTS} ${CONFIG} + eend $? +} + +start_post() { + pgrep -n $(echo ${PNAME} | sed 's/or/e/') > ${PID} +} + +stop() { + ebegin "Stopping samplicator" + start-stop-daemon --stop --quiet --pidfile ${PID} + rm -f ${PID} + eend $? +} + |