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