#!/bin/sh
# Filename:      grml-config
# Purpose:       main configuration interface for running configure scripts on grml system
# Authors:       grml-team (grml.org), (c) Nico Golde <nico@grml.org>, (c) Michael Prokop <mika@grml.org>
# Bug-Reports:   see http://grml.org/bugs/
# License:       This file is licensed under the GPL v2.
################################################################################

PATH=${PATH:-'/bin/:/sbin/:/usr/bin:/usr/sbin'}

# set up some variables
DIALOG=$(which dialog)
PN=$(basename $0)

if [ "$(id -ru)" != "0" ] ; then
   DEFAULTITEM=user
else
   DEFAULTITEM=root
fi

allover() {
MENU=$($DIALOG --stdout --clear --title "$PN" --default-item $DEFAULTITEM --menu \
"Please select the scripts you would like to run.

Report bugs, send whishes and feedback to the grml team:
http://www.grml.org/ - contact (at) grml.org

" 13 65 3 \
"root" "Admin scripts (needs root permissions)" \
"user" "User scripts" \
"exit" "Exit this program")

retval=$?

case $retval in
  0)
        if [ "$MENU" = "root" ]; then
          exec grml-config-root
        fi
        if [ "$MENU" = "user" ]; then
          exec grml-config-user
        fi
        if [ "$MENU" = "exit" ]; then
          exit
        fi
        ;;
  1)
        echo "Cancel pressed.";;
  255)
        echo "ESC pressed.";;
esac
}

allover

## END OF FILE #################################################################
