2 # tvheadend startup script inspired by the Debian one in the package
4 # Author: Yann E. MORIN <yann.morin.1998@free.fr>
6 PATH
=/usr
/sbin
:/usr
/bin
:/sbin
:/bin
9 PIDFILE
=/var
/run
/$NAME.pid
11 [ -f "${DAEMON}" -a -x "${DAEMON}" ] ||
exit 0
13 # Read configuration variable file if it is present
14 [ -r "/etc/default/${NAME}" ] && .
"/etc/default/${NAME}"
17 [ -z "${TVH_USER}" ] || ARGS="${ARGS} -u ${TVH_USER}"
18 [ -z "${TVH_GROUP}" ] || ARGS="${ARGS} -g ${TVH_GROUP}"
19 [ -z "${TVH_ADAPTERS}" ] || ARGS="${ARGS} -a ${TVH_ADAPTERS}"
20 [ -z "${TVH_HTTP_PORT}" ] || ARGS="${ARGS} -w ${TVH_HTTP_PORT}"
21 [ -z "${TVH_HTSP_PORT}" ] || ARGS="${ARGS} -e ${TVH_HTSP_PORT}"
22 [ "${TVH_DEBUG}" = "1" ] && ARGS
="${ARGS} -s"
26 printf "Starting TVHeadend daemon: "
27 if start-stop-daemon
-S -q -p ${PIDFILE} -m --exec "${DAEMON}" -- ${ARGS}; then
34 printf "Stopping TVHeadend daemon: "
35 start-stop-daemon
-K -q -p ${PIDFILE} -s TERM
37 if start-stop-daemon
-K -q -p ${PIDFILE} -t; then
38 printf "failed, killing: "
39 start-stop-daemon
-K -q -p ${PIDFILE} -s KILL
-o
49 echo "Usage: $0 {start|stop|restart|force-reload}" >&2