plymouth 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides: plymouth
  4. # Required-Start: udev $remote_fs $all
  5. # Required-Stop: $remote_fs
  6. # Should-Start: $x-display-manager
  7. # Should-Stop: $x-display-manager
  8. # Default-Start: 2 3 4 5
  9. # Default-Stop: 0 6
  10. # Short-Description: Stop plymouth during boot and start it on shutdown
  11. ### END INIT INFO
  12. PATH="/sbin:/bin:/usr/sbin:/usr/bin"
  13. NAME="plymouth"
  14. DESC="Boot splash manager"
  15. test -x /usr/sbin/plymouthd || exit 0
  16. if [ -r "/etc/default/${NAME}" ]
  17. then
  18. . "/etc/default/${NAME}"
  19. fi
  20. set -e
  21. for ARGUMENT in $(cat /proc/cmdline)
  22. do
  23. case "${ARGUMENT}" in
  24. splash*)
  25. SPLASH="true"
  26. ;;
  27. nosplash*)
  28. SPLASH="false"
  29. ;;
  30. esac
  31. done
  32. case "${1}" in
  33. start)
  34. case "${SPLASH}" in
  35. true)
  36. /usr/bin/plymouth --quit
  37. ;;
  38. esac
  39. ;;
  40. stop)
  41. case "${SPLASH}" in
  42. true)
  43. if ! plymouth --ping
  44. then
  45. /usr/sbin/plymouthd --mode=shutdown --attach-to-session
  46. fi
  47. RUNLEVEL="$(/sbin/runlevel | cut -d " " -f 2)"
  48. case "${RUNLEVEL}" in
  49. 0)
  50. TEXT="Shutting down system..."
  51. ;;
  52. 6)
  53. TEXT="Restarting system..."
  54. ;;
  55. esac
  56. /usr/bin/plymouth message --text="${TEXT}"
  57. /usr/bin/plymouth --show-splash
  58. ;;
  59. esac
  60. ;;
  61. restart|force-reload)
  62. ;;
  63. *)
  64. echo "Usage: ${0} {start|stop|restart|force-reload}" >&2
  65. exit 1
  66. ;;
  67. esac
  68. exit 0