Drop grml-postfix
[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 "user" "User scripts" \
31 "exit" "Exit this program")
32
33 retval=$?
34
35 case $retval in
36   0)
37         if [ "$MENU" = "root" ]; then
38           exec grml-config-root
39         fi
40         if [ "$MENU" = "user" ]; then
41           exec grml-config-user
42         fi
43         if [ "$MENU" = "exit" ]; then
44           exit
45         fi
46         ;;
47   1)
48         echo "Cancel pressed.";;
49   255)
50         echo "ESC pressed.";;
51 esac
52 }
53
54 allover
55
56 ## END OF FILE #################################################################