swupdate-gui 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides: recovery_gui
  4. # Required-Start: $local_fs
  5. # Should-Start:
  6. # Required-Stop: $local_fs
  7. # Should-Stop:
  8. # Default-Start: 2 3 4 5
  9. # Default-Stop: 0 1 6
  10. # Short-Description: Start recovery_gui application
  11. ### END INIT INFO
  12. # The definition of actions:
  13. # start start the service
  14. # stop stop the service
  15. # restart stop and restart the service if the service is already running,
  16. # otherwise start the service
  17. # The start, stop, and restart, actions shall be supported
  18. # by all init scripts;
  19. # PATH should only include /usr/* if it runs after the mountnfs.sh script
  20. PATH=/sbin:/usr/sbin:/bin:/usr/bin
  21. DESC="GUI for SWUpdate"
  22. NAME="recovery_gui"
  23. DAEMON=/usr/bin/recovery_gui
  24. PIDFILE=/var/run/$NAME.pid
  25. # Exit if the package is not installed
  26. [ -x "$DAEMON" ] || exit 0
  27. # Function that starts the daemon/service
  28. #
  29. do_start() {
  30. echo "Starting $DESC ..."
  31. #Export the the screen orientation
  32. rotation=$(fw_printenv -n screen_orientation)
  33. export SCREEN_ORIENTATION_ANGLE=${rotation}
  34. echo 0 > /sys/class/graphics/fbcon/cursor_blink
  35. export LD_PRELOAD=/lib/libpthread.so.0
  36. #Start recovery_gui
  37. start-stop-daemon --start --background --pidfile $PIDFILE --make-pidfile --exec $DAEMON
  38. }
  39. #
  40. # Function that stops the daemon/service
  41. #
  42. do_stop() {
  43. echo "Stopping $DESC"
  44. #Stop recovery_gui
  45. start-stop-daemon --stop --pidfile $PIDFILE
  46. }
  47. case "$1" in
  48. start)
  49. do_start
  50. ;;
  51. stop)
  52. do_stop || exit $?
  53. ;;
  54. restart)
  55. do_stop
  56. do_start
  57. ;;
  58. *)
  59. echo "Usage: $0 {start|stop|restart}" >&2
  60. exit 3
  61. ;;
  62. esac