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.
 
 
 
 
 
 

90 lines
1.3 KiB

  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: gdm gdm3 kdm xdm slim nodm
  7. # Should-Stop: gdm gdm3 kdm xdm slim nodm
  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. SPLASH="false"
  16. if [ -r "/etc/default/${NAME}" ]
  17. then
  18. . "/etc/default/${NAME}"
  19. fi
  20. set -e
  21. Start_plymouthd ()
  22. {
  23. if ! plymouth --ping
  24. then
  25. /sbin/plymouthd --mode=${1} --attach-to-session
  26. fi
  27. }
  28. for ARGUMENT in $(cat /proc/cmdline)
  29. do
  30. case "${ARGUMENT}" in
  31. splash*)
  32. SPLASH="true"
  33. ;;
  34. nosplash*)
  35. SPLASH="false"
  36. ;;
  37. esac
  38. done
  39. case "${1}" in
  40. start)
  41. if [ "${SPLASH}" = "true" ]
  42. then
  43. /bin/plymouth --quit
  44. fi
  45. ;;
  46. stop)
  47. if [ "$SPLASH" = "true" ]
  48. then
  49. Start_plymouthd shutdown
  50. RUNLEVEL="$(/sbin/runlevel | cut -d " " -f 2)"
  51. case "${RUNLEVEL}" in
  52. 0)
  53. TEXT="Shutting down system..."
  54. ;;
  55. 6)
  56. TEXT="Restarting system..."
  57. ;;
  58. esac
  59. /bin/plymouth message --text="${TEXT}"
  60. /bin/plymouth --show-splash
  61. fi
  62. ;;
  63. restart|force-reload)
  64. ;;
  65. *)
  66. N="/etc/init.d/${NAME}"
  67. echo "Usage: ${N} {start|stop|restart|force-reload}" >&2
  68. exit 1
  69. ;;
  70. esac
  71. exit 0