]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
init: added delay option to init
authorAdam Sutton <dev@adamsutton.me.uk>
Sat, 9 Feb 2013 12:51:14 +0000 (12:51 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Sat, 9 Feb 2013 12:51:14 +0000 (12:51 +0000)
debian/tvheadend.default
debian/tvheadend.init
debian/tvheadend.upstart

index 4617c07bcb9c55a01f1d85170ef360708e3cc0a7..29b6dbef8cdec4134b6f7b0e1d0faba65feefd32 100644 (file)
@@ -47,6 +47,10 @@ TVH_HTSP_PORT=""
 #   if set to 1 will output debug to syslog
 TVH_DEBUG=0
 
+# TVH_DELAY
+#   if set startup will be delayed N seconds to allow hardware init
+TVH_DELAY=""
+
 # TVH_ARGS
 #   add any other arguments
 TVH_ARGS=""
index d0fb7dd739f86e7569b07b1a3ea18859f15f78d0..b4aea9cbda3916b79c37c13a43f8671bf720da3f 100644 (file)
@@ -85,6 +85,7 @@ do_stop()
 case "$1" in
   start)
        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+       [ ! -z "$TVH_DELAY" ] && sleep $TVH_DELAY
        do_start
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
index 9fe9baf7e8b991712ca70c1d1a73519c04d7d54b..a5d704045cb12291986c358c216f07cf8c3dfcbf 100644 (file)
@@ -22,11 +22,13 @@ script
   [ -z "$TVH_GROUP"     ] || ARGS="$ARGS -g $TVH_GROUP"
   [ -z "$TVH_CONF_DIR"  ] || ARGS="$ARGS -c $TVH_CONF_DIR"
   [ -z "$TVH_ADAPTERS"  ] || ARGS="$ARGS -a $TVH_ADAPTERS"
-  [ "$TVH_IPV6" == "1"  ] && ARGS="$ARGS -6"
+  [ "$TVH_IPV6" = "1"   ] && ARGS="$ARGS -6"
   [ -z "$TVH_HTTP_PORT" ] || ARGS="$ARGS --http_port $TVH_HTTP_PORT"
   [ -z "$TVH_HTTP_ROOT" ] || ARGS="$ARGS --http_root $TVH_HTTP_ROOT"
   [ -z "$TVH_HTSP_PORT" ] || ARGS="$ARGS --htsp_port $TVH_HTSP_PORT"
   [ "$TVH_DEBUG" = "1"  ] && ARGS="$ARGS -s"
 
+  [ ! -z "$TVH_DELAY" ] && sleep $TVH_DELAY
+
   exec tvheadend $ARGS $TVH_ARGS
 end script