Guest User

Untitled

a guest
Jul 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. #!/bin/bash
  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. # In order to actually use this script you need to implement
  9. # the functions DriverLoaded(), LoadDriver() and UnloadDriver()
  10. # and maybe adjust the VDRPRG and VDRCMD to your particular
  11. # requirements.
  12. #
  13. # Since this script loads the DVB driver, it must be started
  14. # as user 'root'. Add the option "-u username" to run VDR
  15. # under the given user name.
  16. #
  17. # Any command line parameters will be passed on to the
  18. # actual 'vdr' program.
  19. #
  20. # See the main source file 'vdr.c' for copyright information and
  21. # how to reach the author.
  22. #
  23. # $Id: runvdr 2.0 2006/05/14 16:02:05 kls Exp $
  24.  
  25.  
  26. export LANG=de_DE.utf8
  27. export LC_COLLATE=de_DE.utf8
  28.  
  29. PATH=/usr/local/bin:$PATH
  30. VDRPRG="/usr/local/bin/vdr"
  31. VDRCMD="$VDRPRG -w 60 -c /etc/vdr -E /var/vdr -u hendrik \
  32. -L /usr/local/src/vdr/PLUGINS/lib \
  33. -s /usr/local/bin/vdrpoweroff.sh \
  34. -P'xineliboutput --local=sxfe --video=vdpau --display=:0 --primary --post tvtime:method=use_vo_driver --audio=alsa:hw:0,1 -f' \
  35. $*"
  36.  
  37. KILL="/usr/bin/killall -q -TERM"
  38.  
  39. # Detect whether the DVB driver is already loaded
  40. # and return 0 if it *is* loaded, 1 if not:
  41. function DriverLoaded()
  42. {
  43. return 1
  44. }
  45.  
  46. # Load all DVB driver modules needed for your hardware:
  47. function LoadDriver()
  48. {
  49. # return 0
  50. modprobe -r budget_ci
  51. }
  52.  
  53. # Unload all DVB driver modules loaded in LoadDriver():
  54. function UnloadDriver()
  55. {
  56. modprobe -r budget_ci
  57. }
  58.  
  59. # Load driver if it hasn't been loaded already:
  60. if ! DriverLoaded; then
  61. LoadDriver
  62. fi
  63.  
  64. while (true) do
  65. eval "$VDRCMD"
  66. if test $? -eq 0 -o $? -eq 2; then exit; fi
  67. echo "`date` reloading DVB driver"
  68. $KILL $VDRPRG
  69. sleep 10
  70. UnloadDriver
  71. LoadDriver
  72. echo "`date` restarting VDR"
  73. done
Add Comment
Please, Sign In to add comment