#!/sbin/openrc-run depend() { need net } start() { ebegin "Starting tvheadend" checkconf || return 1 start-stop-daemon --start \ --exec ${TVHBIN} -- \ -C -f -u ${TVHUSER} \ -c ${TVHCONF} eend $? } stop() { ebegin "Stopping tvheadend" start-stop-daemon --stop --quiet \ --retry TERM/30/KILL/5 \ --pidfile /var/run/tvheadend.pid eend $? } checkconf() { if [ ! -d "$TVHCONF" ]; then eerror "config directory does not exist!" return 1 fi }