[Buildroot] [PATCH 3/6] package/tvheadend: wait for DVB devices

Yann E. MORIN yann.morin.1998 at free.fr
Sun Feb 17 23:22:29 UTC 2013


Wait for DVB devices before starting up the tvheadend daemon.
Wait for maximum 15 seconds.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
---
 package/tvheadend/S99tvheadend |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/package/tvheadend/S99tvheadend b/package/tvheadend/S99tvheadend
index 407b873..3a1218a 100644
--- a/package/tvheadend/S99tvheadend
+++ b/package/tvheadend/S99tvheadend
@@ -23,6 +23,13 @@ ARGS="-f"
 
 case "$1" in
     start)
+        printf "Waiting for DVB device nodes..."
+        cpt=15
+        while [ ! -d /dev/dvb/adapter0 -a ${cpt} -gt 0 ]; do
+            sleep 1
+            cpt=$((cpt-1))
+        done
+        printf "\n"
         printf "Starting TVHeadend daemon: "
         if start-stop-daemon -S -q -p ${PIDFILE} -m --exec "${DAEMON}" -- ${ARGS}; then
             printf "OK\n"
-- 
1.7.2.5



More information about the buildroot mailing list