Release new version 2.13.0
[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/games:/home/grml/bin
13 CMDLINE=$(cat /proc/cmdline)
14 [ -n "$distri" ] || distri="grml"
15
16 # welcome beep
17 case "$CMDLINE" in
18   *\ nobeep*)
19     ;;
20   *)
21     (for f in 1000 2000 1500 1750; do beep -f $f -l 150; done) &
22     ;;
23 esac
24
25 case "$CMDLINE" in
26    # allow customized startup via bootoption startup:
27    *startup=*)
28        script="$(getBootParam startup)"
29        if [ -x $(which $script) ] ; then
30           $script
31        fi
32        ;;
33
34    # do nothing if booting with bootoption noquick:
35    *\ noquick*)
36       ;;
37    *) # by default run grml-quickconfig, but only if running as root
38       if [ "$(id -u)" = "0" ] ; then
39          which grml-quickconfig &>/dev/null && grml-quickconfig
40       fi
41 esac
42
43 # just print out an empty line if bootoption "nowelcome" is present
44 if grep -q nowelcome /proc/cmdline 2>/dev/null ; then
45   echo
46 # ... otherwise allow customized release information
47 elif [ -r /etc/release_info ] ; then
48   cat /etc/release_info
49 else # ... or finally fall back to grml's default
50   # display version information depending on the version:
51   if grep -q -- '-rc[0-9]' /etc/grml_version 2>/dev/null ; then
52      echo
53      echo
54      echo 'NOTICE: This is a release candidate version!'
55      echo 'Please notice that this is not yet a stable release.'
56      echo 'Please report any bugs you notice: http://grml.org/bugs/'
57      echo
58   fi
59
60   if grep -q 'grml-live-autobuild' /etc/grml_version 2>/dev/null ; then
61      echo
62      echo
63      echo 'NOTICE: This is a daily snapshot version!'
64      echo 'Please notice that this is not yet a stable release.'
65      echo 'See http://daily.grml.org/ for more details.'
66      echo 'Please report any bugs you notice: http://grml.org/bugs/'
67      echo
68   fi
69
70   echo "
71 Welcome to ${GRMLVERSION}!
72
73 New to ${distri}? Want to read some documentation?
74 Start via running 'grml-info'.
75 Get tips and hints via 'grml-tips \$KEYWORD'.
76 New to zsh? Run 'zsh-help'.
77
78 Switch to other consoles via alt-F<number> keys.
79
80 Happy hacking!               http://grml.org/
81 "
82 fi
83
84 exec /bin/zsh -l
85
86 ## END OF FILE #################################################################