* updated kgoldrunner (21.12.1 -> 21.12.2), untested
[t2-trunk.git] / package / base / stone / stone.sh
blobe7c7132469274e02ad8cd19aa4d159f3a94c8c98
1 #!/bin/bash
2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 #
5 # T2 SDE: package/.../stone/stone.sh
6 # Copyright (C) 2004 - 2005 The T2 SDE Project
7 # Copyright (C) 1998 - 2003 ROCK Linux Project
8 #
9 # More information can be found in the files COPYING and README.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; version 2 of the License. A copy of the
14 # GNU General Public License can be found in the file COPYING.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 export SETUPD="${SETUPD:-/etc/stone.d}"
18 if type -p dialog > /dev/null ; then
19 export SETUPG="${SETUPG:-dialog}"
20 else
21 export SETUPG="${SETUPG:-text}"
23 export STONE="`type -p $0`"
25 if [ "$1" = "-text" ] ; then SETUPG="text" ; shift ; fi
26 if [ "$1" = "-dialog" ] ; then SETUPG="dialog" ; shift ; fi
27 if [ "$1" = "-x11" ] ; then SETUPG="x11" ; shift ; fi
29 . ${SETUPD}/gui_${SETUPG}.sh
31 if [ "$1" -a -f "${SETUPD}/mod_$1.sh" ]
32 then
33 . ${SETUPD}/mod_$1.sh ; shift
34 if [ -z "$*" ] ; then
35 main
36 else
37 eval "$*"
39 elif [ "$#" = 0 -a -f ${SETUPD}/default.sh ]
40 then
41 . ${SETUPD}/default.sh
42 elif [ "$#" = 0 ]
43 then
44 while
45 command="gui_menu main 'Main Menu - Select the Subsystem you want to configure'"
46 while read a b c cmd name ; do
47 x="'" ; cmd="${cmd//,/ }"
48 command="$command '${name//$x/$x\\$x$x}'"
49 command="$command '$STONE ${cmd//$x/$x\\$x$x}'"
50 done < <( grep -h '^# \[MAIN\] [0-9][0-9] ' \
51 $SETUPD/mod_*.sh | sort )
52 eval "$command"
53 do : ; done
54 else
55 echo
56 echo "STONE - Setup Tool ONE - System Configuration"
57 echo
58 echo "Usage: $0 [ -text | -dialog | -x11 ] [ module [ command ] ]"
59 echo