Подключение дисплея к Raspberry Pi через сдвиговый регистр 74HC595 http://blindage.org/?p=4835
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

123 lines
2.6 KiB

  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides: lcd
  4. # Required-Start: $remote_fs $syslog
  5. # Required-Stop: $remote_fs $syslog
  6. # Default-Start: 2 3 4 5
  7. # Default-Stop: 0 1 6
  8. # Short-Description: Example initscript
  9. # Description: This file should be used to construct scripts to be
  10. # placed in /etc/init.d.
  11. ### END INIT INFO
  12. # Author: Foo Bar <foobar@baz.org>
  13. #
  14. # Please remove the "Author" lines above and replace them
  15. # with your own name if you copy and modify this script.
  16. # Do NOT "set -e"
  17. # PATH should only include /usr/* if it runs after the mountnfs.sh script
  18. PATH=/sbin:/usr/sbin:/bin:/usr/bin
  19. DESC="LCD Circle"
  20. NAME=lcd
  21. DAEMON=/opt/draw_lcd/circle.sh
  22. DAEMON_ARGS=""
  23. PIDFILE=/var/run/$NAME.pid
  24. SCRIPTNAME=/etc/init.d/$NAME
  25. # Exit if the package is not installed
  26. [ -x "$DAEMON" ] || exit 0
  27. # Read configuration variable file if it is present
  28. [ -r /etc/default/$NAME ] && . /etc/default/$NAME
  29. # Load the VERBOSE setting and other rcS variables
  30. . /lib/init/vars.sh
  31. # Define LSB log_* functions.
  32. # Depend on lsb-base (>= 3.2-14) to ensure that this file is present
  33. # and status_of_proc is working.
  34. . /lib/lsb/init-functions
  35. #
  36. # Function that starts the daemon/service
  37. #
  38. do_start()
  39. {
  40. $DAEMON &
  41. }
  42. #
  43. # Function that stops the daemon/service
  44. #
  45. do_stop()
  46. {
  47. killall $DAEMON
  48. return 0
  49. }
  50. #
  51. # Function that sends a SIGHUP to the daemon/service
  52. #
  53. do_reload() {
  54. #
  55. # If the daemon can reload its configuration without
  56. # restarting (for example, when it is sent a SIGHUP),
  57. # then implement that here.
  58. #
  59. start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
  60. return 0
  61. }
  62. case "$1" in
  63. start)
  64. [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
  65. do_start
  66. case "$?" in
  67. 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
  68. 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
  69. esac
  70. ;;
  71. stop)
  72. [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
  73. do_stop
  74. case "$?" in
  75. 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
  76. 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
  77. esac
  78. ;;
  79. status)
  80. status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
  81. ;;
  82. restart|force-reload)
  83. #
  84. # If the "reload" option is implemented then remove the
  85. # 'force-reload' alias
  86. #
  87. log_daemon_msg "Restarting $DESC" "$NAME"
  88. do_stop
  89. case "$?" in
  90. 0|1)
  91. do_start
  92. case "$?" in
  93. 0) log_end_msg 0 ;;
  94. 1) log_end_msg 1 ;; # Old process is still running
  95. *) log_end_msg 1 ;; # Failed to start
  96. esac
  97. ;;
  98. *)
  99. # Failed to stop
  100. log_end_msg 1
  101. ;;
  102. esac
  103. ;;
  104. *)
  105. #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
  106. echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
  107. exit 3
  108. ;;
  109. esac
  110. :