~burhanilinux/+junk/plymouth

« back to all changes in this revision

Viewing changes to debian/plymouth.init

  • Committer: Juzer Dana
  • Date: 2024-01-14 13:03:08 UTC
  • Revision ID: juzerdana@gmail.com-20240114130308-urizjbjhjqmenga6
New Commit

Show diffs side-by-side

added added

removed removed

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