summaryrefslogtreecommitdiff
path: root/addons/x11infoscreen/etc/init.d/local-infoscreen
blob: c9ef034d23704588a847f977789cd77d97a6fd99 (plain)
  1. #! /bin/sh
  2. #
  3. # local-infoscreen
  4. #
  5. # Author: Jonas Smedegaard <dr@jones.dk>
  6. #
  7. set -e
  8. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  9. DESC="infoscreen daemons"
  10. NAME=infoscreen
  11. DAEMON=/usr/sbin/$NAME
  12. PIDFILE=/var/run/$NAME.pid
  13. SCRIPTNAME=/etc/init.d/$NAME
  14. # Gracefully exit if the package has been removed.
  15. #test -x $DAEMON || exit 0
  16. # Read config file if it is present.
  17. #if [ -r /etc/default/$NAME ]
  18. #then
  19. # . /etc/default/$NAME
  20. #fi
  21. #
  22. # Function that starts the daemon/service.
  23. #
  24. d_start() {
  25. # start-stop-daemon --start --quiet --pidfile $PIDFILE \
  26. # --exec $DAEMON
  27. killall XFree86 -wq || /bin/true
  28. /usr/local/bin/launch-x11
  29. /usr/local/bin/launch-sync
  30. sleep 5
  31. /usr/local/bin/launch-unclutter
  32. # /usr/local/bin/launch-feh
  33. /usr/local/bin/launch-qiv
  34. }
  35. #
  36. # Function that stops the daemon/service.
  37. #
  38. d_stop() {
  39. # start-stop-daemon --stop --quiet --pidfile $PIDFILE \
  40. # --name $NAME
  41. /usr/local/bin/launch-qiv -k || /bin/true
  42. # /usr/local/bin/launch-feh -k || /bin/true
  43. /usr/local/bin/launch-unclutter -k || /bin/true
  44. /usr/local/bin/launch-sync -k || /bin/true
  45. /usr/local/bin/launch-x11 -k || /bin/true
  46. killall XFree86 -wq || /bin/true
  47. }
  48. #
  49. # Function that sends a SIGHUP to the daemon/service.
  50. #
  51. d_reload() {
  52. start-stop-daemon --stop --quiet --pidfile $PIDFILE \
  53. --name $NAME --signal 1
  54. }
  55. case "$1" in
  56. start)
  57. echo -n "Starting $DESC: $NAME"
  58. d_start
  59. echo "."
  60. ;;
  61. stop)
  62. echo -n "Stopping $DESC: $NAME"
  63. d_stop
  64. echo "."
  65. ;;
  66. #reload)
  67. #
  68. # If the daemon can reload its configuration without
  69. # restarting (for example, when it is sent a SIGHUP),
  70. # then implement that here.
  71. #
  72. # If the daemon responds to changes in its config file
  73. # directly anyway, make this an "exit 0".
  74. #
  75. # echo -n "Reloading $DESC configuration..."
  76. # d_reload
  77. # echo "done."
  78. #;;
  79. restart|force-reload)
  80. #
  81. # If the "reload" option is implemented, move the "force-reload"
  82. # option to the "reload" entry above. If not, "force-reload" is
  83. # just the same as "restart".
  84. #
  85. echo -n "Restarting $DESC: $NAME"
  86. d_stop
  87. sleep 1
  88. d_start
  89. echo "."
  90. ;;
  91. *)
  92. # echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
  93. echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
  94. exit 1
  95. ;;
  96. esac
  97. exit 0