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