]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - config/vdr/bin/runvdr
script to start vdr with softdevice
[people/teissler/ipfire-2.x.git] / config / vdr / bin / runvdr
1 #!/bin/sh
2
3 # runvdr: Loads the DVB driver and runs VDR
4 #
5 # If VDR exits abnormally, the driver will be reloaded
6 # and VDR restarted.
7 #
8 # Any command line parameters will be passed on to the
9 # actual 'vdr' program.
10 #
11
12 PLUGOPTS="-Pstreamdev-server"
13
14 VDRPRG="./bin/vdr"
15 VDRCMD="$VDRPRG -w 60 -c /opt/vdr/etc $PLUGOPTS $*"
16
17 KILL="killall -q -TERM"
18
19 if [ "$(ps -A | grep " vdr")" != "" ]; then
20 echo vdr is already running!
21 exit 1
22 fi
23
24 mkdir -p /var/video
25 cd /opt/vdr
26 while (true) do
27 #
28 # If you have stability Problems at tuning or similar
29 # unload and reload the dvb-modules here ...
30 # Example is for Hauppauge Nexus 2.0
31 #
32 # rmmod dvb_ttpci
33 # rmmod stv0299
34 # rmmod dvb_core
35 # modprobe dvb_ttpci
36 #
37 sleep 1
38 eval "$VDRCMD"
39 if test $? -eq 0 -o $? -eq 2; then exit; fi
40 $KILL $VDRPRG
41 sleep 10
42 echo "`date` restarting VDR"
43 done