home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / init.d / keyboard-setup < prev    next >
Encoding:
Text File  |  2013-01-05  |  1.6 KB  |  67 lines

  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          keyboard-setup
  4. # Required-Start:    mountkernfs
  5. # Required-Stop:
  6. # Should-Start:      keymap udev
  7. # X-Start-Before:    checkroot
  8. # Default-Start:     S
  9. # Default-Stop:
  10. # X-Interactive:     true
  11. # Short-Description: Set preliminary keymap
  12. # Description:       Set the console keyboard as early as possible
  13. #                    so during the file systems checks the administrator
  14. #                    can interact.  At this stage of the boot process
  15. #                    only the ASCII symbols are supported.
  16. ### END INIT INFO
  17.  
  18. set -e
  19.  
  20. # This script is not used by keyboard-configuration.  It is used
  21. # jointly by console-setup and console-setup-mini
  22.  
  23. test -f /bin/setupcon || exit 0
  24.  
  25. if [ -f /etc/default/locale ]; then
  26.     # In order to permit auto-detection of the charmap when
  27.     # console-setup-mini operates without configuration file.
  28.     . /etc/default/locale
  29.     export LANG
  30. fi
  31.  
  32. if [ -f /lib/lsb/init-functions ]; then
  33.     . /lib/lsb/init-functions
  34. else
  35.     log_action_begin_msg () {
  36.     echo -n "$@... "
  37.     }
  38.  
  39.     log_action_end_msg () {
  40.     if [ "$1" -eq 0 ]; then 
  41.         echo done.
  42.     else
  43.         echo failed.
  44.     fi
  45.     }
  46. fi
  47.  
  48. case "$1" in
  49.     stop|status)
  50.         # keyboard-setup isn't a daemon
  51.         ;;
  52.     start|force-reload|restart|reload)
  53.     log_action_begin_msg "Setting preliminary keymap"
  54.     if setupcon -k 2>/dev/null; then
  55.         log_action_end_msg 0
  56.     else
  57.         log_action_end_msg $?
  58.     fi
  59.     ;;
  60.     *)
  61.         echo 'Usage: /etc/init.d/keyboard-setup {start|reload|restart|force-reload|stop|status}'
  62.         exit 1
  63.         ;;
  64. esac
  65.  
  66. exit 0
  67.