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