-
Notifications
You must be signed in to change notification settings - Fork 7
/
grml-bootsplash
executable file
·86 lines (62 loc) · 3.24 KB
/
grml-bootsplash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# Filename: grml-bootsplash
# Purpose: simple text based bootsplash
# Authors: (c) Florian Keller <Florian.Keller@zuerich.ch>, (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
################################################################################
if [ -z "$1" ] ; then
STATUS='| not set ||'
else
STATUS="$1" # maximum: 12 '|'
fi
COUNT=$(echo -n "$STATUS" | wc -c)
if [ "$COUNT" -gt 12 ] ; then
COUNT=12 # more than 12 characters are not supported
STATUS="||||||||||||"
fi
PLACEHOLDER=""
BOOTSPLASH=$(mktemp)
echo -ne '\033[H\033[25l'
cat > $BOOTSPLASH << 'EOTA'
.----------------. .----------------. .----------------. .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. |
| | ______ | || | _______ | || | ____ ____ | || | _____ | |
| | .' ___ | | || | |_ __ \ | || ||_ \ / _|| || | |_ _| | |
| | / .' \_| | || | | |__) | | || | | \/ | | || | | | | |
| | | | ____ | || | | __ / | || | | |\ /| | | || | | | _ | |
| | \ `.___] _| | || | _| | \ \_ | || | _| |_\/_| |_ | || | _| |__/ | | |
| | `._____.' | || | |____| |___| | || ||_____||_____|| || | |________| | |
| | | || | | || | | || | | |
| '--------------' || '--------------' || '--------------' || '--------------' |
'----------------' '----------------' '----------------' '----------------'
_______________________________________________________________________
| |
| .''''. |
| _.-'/ | \ |
| , _.-" ,| / a `-. |
| |\ .-" `--""-.__.'==========================-, |
| \ '-'` .___.--._)==============================| |
| \ .' | | |
| | /,_.-' | Loading grml system ... | |
| _/ _.'( | (press alt+f1 to exit splash) | |
| / ,-' \ \ | | |
EOTA
echo -n " | \ \ \`-' | 0% -[" >> $BOOTSPLASH
echo -en "[1;32m$STATUS[0;39m" >> $BOOTSPLASH
COUNT=$(expr 13 - $COUNT)
for (( i=1 ; i < ${COUNT} ; i++ )); do
PLACEHOLDER="$PLACEHOLDER "
done
echo -n "$PLACEHOLDER" >> $BOOTSPLASH
echo "]- 100% | |" >> $BOOTSPLASH
cat >> $BOOTSPLASH << 'EOTA'
| `-' '-------------------------------' |
| |
| |
| |
|_______________________________________________________________________|
EOTA
cat $BOOTSPLASH
rm -f $BOOTSPLASH &>/dev/null
## END OF FILE #################################################################