forked from OlegKyiashko/RK29kitchen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.sh
executable file
·62 lines (51 loc) · 921 Bytes
/
menu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
#set -vx
BASEDIR=`dirname $0`
pushd "$BASEDIR"
BASEDIR=`pwd`
popd
WORKDIR=${1:-`pwd`}
pushd "$WORKDIR"
WORKDIR=`pwd`"/"
popd
if [ "${WORKDIR}" == "${BASEDIR}" ]
then
WORKDIR="${WORKDIR}/work/"
fi
BINDIR="${BASEDIR}/bin"
LOGFILE="${BASEDIR}/log"
PLUGINS="${BASEDIR}/plugins"
PATH="${BINDIR}":$PATH
export BASEDIR WORKDIR BINDIR LOGFILE PATH PLUGINS
rm "${LOGFILE}"
touch "${LOGFILE}"
chmod +x "${BINDIR}/"*
pushd "${PLUGINS}"
for file in `ls -1 [0-9][0-9]\.*\.sh`
do
chmod +x $file
source $file
done
popd
MenuAdd "Exit" "exit 0"
cd "${WORKDIR}"
workdir_Test
if [ ${WORKTYPE} -eq 99 ]
then
workdir_Select
fi
while [ true ]
do
dialogBT
echo $MENUITEMS|xargs dialog --colors --backtitle "${DIALOGBT}" --title 'RK29xx toolkit' --menu "Select command" 20 70 15 2> $tempfile
case $? in
0)
s=`cat $tempfile`
${FUNCTION[$s]}
;;
*)
break
;;
esac
pressEnterToContinue
done