]>
Commit | Line | Data |
---|---|---|
42d62a83 AF |
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 | ||
2adf5286 AF |
12 | PLUGOPTS="-Pstreamdev-server" |
13 | ||
42d62a83 | 14 | VDRPRG="./bin/vdr" |
0e07ae54 | 15 | VDRCMD="/bin/nice --11 $VDRPRG -w 60 -c /opt/vdr/etc $PLUGOPTS $*" |
42d62a83 AF |
16 | |
17 | KILL="killall -q -TERM" | |
18 | ||
2adf5286 AF |
19 | if [ "$(ps -A | grep " vdr")" != "" ]; then |
20 | echo vdr is already running! | |
21 | exit 1 | |
22 | fi | |
23 | ||
42d62a83 AF |
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 |