-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathswitch_to_db.sh
executable file
·46 lines (41 loc) · 960 Bytes
/
switch_to_db.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
#!/usr/bin/bash
#this script takes database name as argument 1 $1
if [ -d /var/7amasaDB/$1 -a $1 ]
then
while true
do
DBForm=$(yad \
--center \
--title "7amasa DB Engine" \
--text-align=center \
--text "$1" \
--button="1) Add Table":1 \
--button="2) Delete existing Table":2 \
--button="3) switch to table":3 \
--button="4) back":4 \
)
choice=$?
case $choice in
1) ./create_table.sh $1
;;
2) ./delete_table.sh $1
continue
;;
3) ./table_index.sh $1
continue
;;
4) break
;;
252) kill -9 `ps --pid $$ -oppid=`; exit
;;
esac
done
else
tmpForm=$(yad \
--center \
--title "7amasa DB Engine" \
--text "$1 Database not found" \
--button=gtk-go-back:1 \
)
continue
fi