Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  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. # 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. VDRCMD="$VDRPRG -w 60 -c /var/vdr -E /var/vdr -l 1 --no-kbd --video=/home/xbmc/MyVideos --localedir=/usr/local/share/locale \
  27. -P'dvbapi' \
  28. -P'vnsiserver -t 5' $*"
  29.  
  30. KILL="/usr/bin/killall -q -TERM"
  31.  
  32. # Detect whether the DVB driver is already loaded
  33. # and return 0 if it *is* loaded, 1 if not:
  34. DriverLoaded()
  35. {
  36. return 1
  37. }
  38.  
  39. # Load all DVB driver modules needed for your hardware:
  40. LoadDriver()
  41. {
  42. return 0
  43. }
  44.  
  45. # Unload all DVB driver modules loaded in LoadDriver():
  46. UnloadDriver()
  47. {
  48. return 0
  49. }
  50.  
  51. # Load driver if it hasn't been loaded already:
  52. if ! DriverLoaded; then
  53. LoadDriver
  54. fi
  55.  
  56. # export VDR_LANG="de_DE.ISO-8859-15@euro"
  57. export VDR_CHARSET_OVERRIDE="ISO-8859-15"
  58. export LANG="de_DE.UTF-8"
  59. # export LC_COLLATE="de_DE.ISO-8859-15@euro"
  60. # export LC_ALL="de_DE.ISO-8859-15@euro"
  61.  
  62. while (true) do
  63. eval "$VDRCMD"
  64. if test $? -eq 0 -o $? -eq 2; then exit; fi
  65. echo "`date` reloading DVB driver"
  66. $KILL $VDRPRG
  67. sleep 10
  68. UnloadDriver
  69. LoadDriver
  70. echo "`date` restarting VDR"
  71. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement