-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainMenu.sh
executable file
·82 lines (57 loc) · 2.55 KB
/
MainMenu.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
68
69
70
71
72
#! /usr/bin/bash
source ./DB_Functions.sh
mkdir -p DB
function mainmenu {
while [ True ]
do
#echo "Enter your Choice: "
#echo "*********************"
# Show main menu
choice=$(zenity --list --title="Main Menu" --column="Options" --hide-header Create\ DB Connect\ DB List\ DB Drop\ DB Exit)
#select choice in "Create DB" "Cocnnect DB" "List DB" "Drop DB" "Exit"
#select choice in "Create DB" "Connect DB" "List DB" "Drop DB" "Exit"
#do
case $choice in
Create\ DB )
#clear
#echo "****************"
#read -r -p "Enter a Database name please: " databasename
databasename=$(zenity --entry --text="Enter database name:")
Create_db "$databasename"
break ;;
Connect\ DB )
#clear
#echo "****************"
#read -r -p "Enter a Database to connect please: " databasename
databasename=$(zenity --entry --text="Enter database name:")
Connect_db "$databasename"
break ;;
List\ DB )
#clear
#echo "****************"
#echo "Here are the avilable Databases"
(zenity --progress --text="Loading databases..." --percentage=0 &)
List_db
(zenity --progress --text="Loading databases..." --percentage=100 &)
break ;;
Drop\ DB )
#clear
#echo "****************"
#read -p "Enter a Database to drop it please: " databasename
databasename=$(zenity --entry --text="Enter database name:")
Drop_db "$databasename"
break ;;
Exit )
#clear
exit;;
* )
#clear
#echo "Invalid Choice, Please try again"
#echo "********************************"
zenity --error --text="Invalid choice. Please try again."
break ;;
esac
#done
done
}
mainmenu