Fix: Erase all forgotten stuff from grml-config-user [Closes: issue1272]
[grml-scripts.git] / usr_sbin / grml-config
1 #!/bin/sh
2 # Filename:      grml-config
3 # Purpose:       main configuration interface for running configure scripts on grml system
4 # Authors:       grml-team (grml.org), (c) Nico Golde <nico@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 PATH=${PATH:-'/bin/:/sbin/:/usr/bin:/usr/sbin'}
10
11 # set up some variables
12 DIALOG=$(which dialog)
13 PN=$(basename $0)
14
15 if [ "$(id -ru)" != "0" ] ; then
16    DEFAULTITEM=user
17 else
18    DEFAULTITEM=root
19 fi
20
21 allover() {
22 MENU=$($DIALOG --stdout --clear --title "$PN" --default-item $DEFAULTITEM --menu \
23 "Please select the scripts you would like to run.
24
25 Report bugs, send whishes and feedback to the grml team:
26 http://www.grml.org/ - contact (at) grml.org
27
28 " 13 65 3 \
29 "root" "Admin scripts (needs root permissions)" \
30 "exit" "Exit this program")
31
32 retval=$?
33
34 case $retval in
35   0)
36         if [ "$MENU" = "root" ]; then
37           exec grml-config-root
38         fi
39         if [ "$MENU" = "exit" ]; then
40           exit
41         fi
42         ;;
43   1)
44         echo "Cancel pressed.";;
45   255)
46         echo "ESC pressed.";;
47 esac
48 }
49
50 allover
51
52 ## END OF FILE #################################################################