Depend on console-tools; drop runit
[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: Sam Jun 23 23:53:09 CEST 2007 [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 [ -r /etc/hostname ] && HOSTNAME=$(cat /etc/hostname) || HOSTNAME='grml'
14
15 # allow customized release information
16 [ -r /etc/release_info ] && cat /etc/release_info
17
18 PATH=$HOME/bin:/bin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/games:/home/grml/bin
19
20 CMDLINE=$(cat /proc/cmdline)
21 case "$CMDLINE" in
22    # allow customized startup via bootoption startup:
23    *startup*)
24        script="$(getBootParam startup)"
25        if [ -x $(which $script) ] ; then
26           $script
27        fi
28        ;;
29    # turn on speakers for accessibility users:
30    *swspeak*|*blind*|*brltty*|*speakup*)
31       if [ -x /usr/bin/flite ] ; then
32          aumix -w 90 -v 90 -p 90 -m 90
33          flite -o play -t "Finished booting"
34       fi
35       ;;
36
37    # do nothing if booting with noquick:
38    noquick)
39       ;;
40    *) # by default run grml-quickconfig, but only if running as root
41       if [ $(id -u) = "0" ] ; then
42          # do not run grml-quickconfig on grml-small
43          if ! grep -q small /etc/grml_version ; then
44             [ -x /usr/sbin/grml-quickconfig ] && /usr/sbin/grml-quickconfig
45          fi
46       fi
47 esac
48
49 # just print out one single line if bootoption nowelcome is present,
50 # otherwise print usual welcome screen
51 if grep nowelcome /proc/cmdline 2>/dev/null ; then
52    echo
53 else
54    echo "
55
56 Welcome to $HOSTNAME ${GRMLVERSION}!
57
58 New to grml? Want to read some documentation?
59 Start via running 'grml-info'.
60 Get tips and hints via 'grml-tips \$KEYWORD'.
61 New to zsh? Run 'zsh-help'.
62
63 Switch to other consoles via alt-F<number> keys.
64
65 Happy hacking!               http://grml.org/
66 "
67 fi
68
69 exec /bin/zsh -l
70
71 ## END OF FILE #################################################################