Advertisement
Guest User

Untitled

a guest
Mar 9th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. dad@NewMyth:~$ more /usr/share/mythtv/mythfrontend.sh
  2. #!/bin/sh
  3. # Mario Limonciello, March 2007
  4. # partially merged with startmythtv.sh by Michael Haas, October 2007
  5.  
  6. pidof mythfrontend.real 2>&1 >/dev/null && wmctrl -a "MythTV Frontend" 2>/dev/null && exit 0
  7.  
  8. #source our dialog functions
  9. . /usr/share/mythtv/dialog_functions.sh
  10.  
  11. #find the session, dialog, and su manager we will be using for display
  12. find_session
  13. find_dialog
  14. find_su
  15.  
  16. #check that we are in the mythtv group
  17. check_groups
  18.  
  19. if [ "$1" = "--service" ]; then
  20. #source frontend session settings
  21. if [ -f /etc/mythtv/session-settings ]; then
  22. . /etc/mythtv/session-settings
  23. fi
  24. echo "Please note: additional command line arguments will not be passed"
  25. echo " to mythfrontend when using --service"
  26. echo "Please set them in /etc/mythtv/session-settings instead"
  27.  
  28. #if group membership is okay, go ahead and launch
  29. if [ "$IGNORE_NOT" = "0" ]; then
  30. # start mythtv frontend software
  31. if [ "$MYTHWELCOME" = "true" ]; then
  32. # Note: if mythwelcome would support -O to override database settings,
  33. # we could tell it to start the frontend with $MYTHFRONTEND_OPTS
  34. # This is not possible yet, but maybe it'll happen in the future
  35. exec mythwelcome --syslog local7
  36. else
  37. until /usr/bin/mythfrontend.real --syslog local7 ${MYTHFRONTEND_OPTS}
  38. RET=$?
  39. [ "$RET" = "0" -o "$RET" = "1" -o "$RET" = "254" ]
  40. do
  41. notify-send -i info 'Restarting Frontend' "The front-end crashed unexpectedly (exit code $RET) and is restarting. Please wait..."
  42. done
  43. fi
  44. fi
  45. # if we're not in --service mode, just behave normally
  46. elif [ "$1" != "--service" ]; then
  47. # if group membership is okay, go ahead and launch
  48. if [ "$IGNORE_NOT" = "0" ]; then
  49. exec /usr/bin/mythfrontend.real --syslog local7 "$@"
  50. fi
  51. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement