grml-exec-wrapper: add double quotes around $@
[grml-scripts.git] / usr_bin / zsh-login
1 #!/bin/sh
2 # Filename:      zsh-login
3 # Purpose:       customized zsh login welcome screen for use at grml
4 # Authors:       grml-team (grml.org), (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: Son Mär 09 15:11:56 CET 2008 [mika]
8 ################################################################################
9
10 . /etc/grml/sh-lib
11
12 [ -r /etc/grml_version ] && GRMLVERSION=$(cat /etc/grml_version) || GRMLVERSION='(no version information available)'
13
14 # allow customized release information
15 [ -r /etc/release_info ] && cat /etc/release_info
16
17 PATH=$HOME/bin:/bin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/games:/home/grml/bin
18
19 # Activate unicode console if running within utf8 environment
20 # Dirty hack to fix unicode issue on amd64...
21 # unicode_start during bootprocess just does not work reliable :(
22 NUM_CONSOLES=12
23 if [ -r /etc/default/locale ] ; then
24    if grep -q "LANG=.*UTF" /etc/default/locale ; then
25        for vc in `seq 1 ${NUM_CONSOLES}` ; do
26            echo -n -e '\033%G' > /dev/tty${vc}
27        done
28        kbd_mode -u
29        dumpkeys | loadkeys --unicode > /dev/null
30    fi
31 fi
32
33 CMDLINE=$(cat /proc/cmdline)
34 case "$CMDLINE" in
35    # allow customized startup via bootoption startup:
36    *startup*)
37        script="$(getBootParam startup)"
38        if [ -x $(which $script) ] ; then
39           $script
40        fi
41        ;;
42    # turn on speakers for accessibility users:
43    *swspeak*|*blind*|*brltty*|*speakup*)
44       if [ -x /usr/bin/flite ] ; then
45          aumix -w 90 -v 90 -p 90 -m 90
46          flite -o play -t "Finished booting"
47       fi
48       ;;
49
50    # do nothing if booting with bootoption noquick:
51    *noquick*)
52       ;;
53    *) # by default run grml-quickconfig, but only if running as root
54       if [ $(id -u) = "0" ] ; then
55          # do not run grml-quickconfig on grml-small
56          if ! grep -q small /etc/grml_version ; then
57             [ -x /usr/sbin/grml-quickconfig ] && /usr/sbin/grml-quickconfig
58          fi
59       fi
60 esac
61
62 # display version information depending on the version:
63 if grep -q -- '-rc[0-9]' /etc/grml_version 2>/dev/null ; then
64    echo
65    echo
66    echo 'NOTICE: This is a release candidate of grml!'
67    echo 'Please notice that this is not yet a stable release.'
68    echo 'See http://wiki.grml.org/doku.php?id=release_candidate for known issues.'
69    echo 'Please report any bugs you notice: bugs@grml.org'
70    echo
71 fi
72
73 if grep -q 'grml-live-autobuild' /etc/grml_version 2>/dev/null ; then
74    echo
75    echo
76    echo 'NOTICE: This is a daily snapshot version of grml!'
77    echo 'Please notice that this is not yet a stable release.'
78    echo 'See http://daily.grml.org/ for more details.'
79    echo 'Please report any bugs you notice: daily@grml.org'
80    echo
81 fi
82
83 # just print out one single line if bootoption nowelcome is present,
84 # otherwise print usual welcome screen
85 if grep -q nowelcome /proc/cmdline 2>/dev/null ; then
86    echo
87 else
88    echo "
89
90 Welcome to ${GRMLVERSION}!
91
92 New to grml? Want to read some documentation?
93 Start via running 'grml-info'.
94 Get tips and hints via 'grml-tips \$KEYWORD'.
95 New to zsh? Run 'zsh-help'.
96
97 Switch to other consoles via alt-F<number> keys.
98
99 Happy hacking!               http://grml.org/
100 "
101 fi
102
103 exec /bin/zsh -l
104
105 ## END OF FILE #################################################################