-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.sh
executable file
·67 lines (55 loc) · 1.08 KB
/
index.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
62
63
64
65
66
67
#!/usr/bin/bash
#next if checks if database engine not installed, then exit the script
if [ ! -d /var/7amasaDB ]
then
echo "Engine is not installed, please install it firstly using install_engine.sh script"
exit
fi
while true
do
mainForm=$(yad \
--center \
--title "7amasa DB Engine" \
--text "Welcome to 7amasaDB" \
--text-align=center \
--button="1) Create New Database":1 \
--button="2) Delete Existing Database":2 \
--button="3) Switch to Database":3 \
--button="4) exit":4 \
)
choice=$?
case $choice in
1) ./create_db.sh
continue
;;
2) ./delete_database.sh
continue
;;
3) tmpForm=$(yad \
--center \
--title "7amasa DB Engine" \
--form --field="Enter Database Name" \
--button=gtk-ok:0 \
--button=gtk-cancel:1 \
)
choice0=$?
if [ $choice0 = 1 ]
then
continue
elif [ $choice0 = 252 ]
then
kill -9 `ps --pid $$ -oppid=`; exit
elif [ $choice0 = 0 ]
then
DBName=$(echo $tmpForm | awk 'BEGIN {FS="|" } { print $1 }')
./switch_to_db.sh $DBName
fi
continue
;;
4)
exit
;;
252) exit
;;
esac
done