From 0f4001f8f48a873e3bee7eb9d5688cda4e1f0a85 Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Sun, 4 May 2008 15:15:09 +0200 Subject: [PATCH] Check added to prevent the vdr start if no DVB card is present --- config/vdr/bin/runvdr | 12 +++++++++++- src/initscripts/init.d/vdr | 12 ++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/config/vdr/bin/runvdr b/config/vdr/bin/runvdr index b67728ab85..ba2d35ecd9 100755 --- a/config/vdr/bin/runvdr +++ b/config/vdr/bin/runvdr @@ -33,8 +33,18 @@ while (true) do # rmmod stv0299 # rmmod dvb_core # modprobe dvb_ttpci +# sleep 5 +# +# Check if DVB device is present / remove this check if you +# would use vdr as streaming client only +# + if [ ! -e /dev/dvb/adapter0/frontend0 ]; then + echo No DVB tuner found! + exit 1 + fi +# +# Run VDR # - sleep 1 eval "$VDRCMD" if test $? -eq 0 -o $? -eq 2; then exit; fi $KILL $VDRPRG diff --git a/src/initscripts/init.d/vdr b/src/initscripts/init.d/vdr index eb170be2e8..39067d8db9 100644 --- a/src/initscripts/init.d/vdr +++ b/src/initscripts/init.d/vdr @@ -23,6 +23,18 @@ case "${1}" in echo_failure exit 1; fi + if [ ! -e /dev/dvb/adapter0/frontend0 ]; then + boot_mesg "Error! No DVB tuner found." + echo_failure + exit 1; + fi + + if [ "$(ps -A | grep runvdr)" != "" ]; then + boot_mesg "Error! Alrady run!" + echo_failure + exit 1; + fi + loadproc screen -dmS vdr /opt/vdr/bin/runvdr ;; -- 2.39.2