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