summaryrefslogtreecommitdiffstats
path: root/package/tvheadend/S99tvheadend
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2012-12-28 12:37:43 +0000
committerPeter Korsgaard <jacmet@sunsite.dk>2012-12-28 23:40:26 +0100
commit14989d0be59762a354e7c5c15a2eeb4826d8040b (patch)
treef47c0c5725cecb619552786fafad18d9fe5c924b /package/tvheadend/S99tvheadend
parent6904b0ea954c22f3efb9619dc4a7b793fe985547 (diff)
downloadbuildroot-novena-14989d0be59762a354e7c5c15a2eeb4826d8040b.tar.gz
buildroot-novena-14989d0be59762a354e7c5c15a2eeb4826d8040b.zip
package/tvheadend: new package
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/tvheadend/S99tvheadend')
-rw-r--r--package/tvheadend/S99tvheadend54
1 files changed, 54 insertions, 0 deletions
diff --git a/package/tvheadend/S99tvheadend b/package/tvheadend/S99tvheadend
new file mode 100644
index 000000000..407b8736a
--- /dev/null
+++ b/package/tvheadend/S99tvheadend
@@ -0,0 +1,54 @@
+#! /bin/sh
+# tvheadend startup script inspired by the Debian one in the package
+
+# Author: Yann E. MORIN <yann.morin.1998@free.fr>
+
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+NAME=tvheadend
+DAEMON=/usr/bin/$NAME
+PIDFILE=/var/run/$NAME.pid
+
+[ -f "${DAEMON}" -a -x "${DAEMON}" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r "/etc/default/${NAME}" ] && . "/etc/default/${NAME}"
+
+ARGS="-f"
+[ -z "${TVH_USER}" ] || ARGS="${ARGS} -u ${TVH_USER}"
+[ -z "${TVH_GROUP}" ] || ARGS="${ARGS} -g ${TVH_GROUP}"
+[ -z "${TVH_ADAPTERS}" ] || ARGS="${ARGS} -a ${TVH_ADAPTERS}"
+[ -z "${TVH_HTTP_PORT}" ] || ARGS="${ARGS} -w ${TVH_HTTP_PORT}"
+[ -z "${TVH_HTSP_PORT}" ] || ARGS="${ARGS} -e ${TVH_HTSP_PORT}"
+[ "${TVH_DEBUG}" = "1" ] && ARGS="${ARGS} -s"
+
+case "$1" in
+ start)
+ printf "Starting TVHeadend daemon: "
+ if start-stop-daemon -S -q -p ${PIDFILE} -m --exec "${DAEMON}" -- ${ARGS}; then
+ printf "OK\n"
+ else
+ printf "failed\n"
+ fi
+ ;;
+ stop)
+ printf "Stoping TVHeadend daemon: "
+ start-stop-daemon -K -q -p ${PIDFILE} -s TERM
+ sleep 2
+ if start-stop-daemon -K -q -p ${PIDFILE} -t; then
+ printf "failed, killing: "
+ start-stop-daemon -K -q -p ${PIDFILE} -s KILL -o
+ fi
+ printf "OK\n"
+ ;;
+ restart|force-reload)
+ "${0}" stop
+ sleep 2
+ "${0}" stop
+ ;;
+ *)
+ echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+: