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