ayaports/unmaintained/logitechmediaserver/logitechmediaserver.initd

37 lines
953 B
Text
Raw Normal View History

2021-06-04 15:24:22 +00:00
#!/sbin/openrc-run
# Distributed under the terms of the GNU General Public License, v2 or later
LOGITECHMS_HOME=${LOGITECHMS_HOME:-/var/lib/${SVCNAME}}
LOGITECHMS_USER=${LOGITECHMS_USER:-${SVCNAME}}
PIDFILE=/run/logitechmediaserver/logitechmediaserver.pid
depend() {
after net
}
start() {
checkpath -dq -o ${LOGITECHMS_USER}:${LOGITECHMS_USER} -m 755 /run/logitechmediaserver/
ebegin "Starting ${SVCNAME}"
start-stop-daemon \
--start --user "${LOGITECHMS_USER}" --name logitechmediaserver \
--env HOME="${LOGITECHMS_HOME}" --exec /usr/bin/logitechmediaserver \
--pidfile="${PIDFILE}" \
--nicelevel "${NICELEVEL}" \
-- \
--prefsdir=${LOGITECHMS_HOME}/prefs \
--cachedir=${LOGITECHMS_HOME}/cache \
--logdir=${LOGITECHMS_HOME}/Logs \
--noimage --novideo
eend $?
}
stop() {
ebegin "Stopping ${SVCNAME}"
start-stop-daemon --stop --user "${LOGITECHMS_USER}" \
--pidfile "${PIDFILE}" \
--wait 15000 \
--progress
eend $?
}