-
Notifications
You must be signed in to change notification settings - Fork 1
/
ZamalekDB-Engine.sh
executable file
·56 lines (49 loc) · 1.12 KB
/
ZamalekDB-Engine.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
#! /bin/bash
if [[ -d data ]]
then
mkdir data
fi
source ./Color-Variables.sh
function Main-Menu {
currentDB=""
PS3="${yellow}Enter Your Choice : ${reset}"
options=("Creat a DB" "List existing databases" "Use Database" "Drop Databse" "Exit");
optionsLength=${#options[@]};
i=0;
echo "${cyan}"
while [ $i -lt $optionsLength ]
do
echo $(( $i + 1 ))")" ${options[i]}
i=$(( $i + 1 ))
done
echo "${reset}"
read -p "${yellow}Enter Your Choice : ${reset}" excuteQuery;
case $excuteQuery in
[1-$optionsLength])
if [ $excuteQuery -eq 1 ]
then
source ./Creat-Database.sh
elif [ $excuteQuery -eq 2 ]
then
source ./List-Databases.sh
elif [ $excuteQuery -eq 3 ]
then
source ./Use-Database.sh
elif [ $excuteQuery -eq 4 ]
then
source ./Drop-Database.sh
elif [ $excuteQuery -eq 5 ]
then
exit
fi
;;
*)
echo "${red}Invalid selection.${reset}"
;;
esac
}
clear
while [[ true ]]
do
Main-Menu
done