-
Notifications
You must be signed in to change notification settings - Fork 0
/
connect.sh
46 lines (38 loc) · 1.01 KB
/
connect.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
#!/bin/bash
SERVER_CONTAINER=edu_jennifer_server
IHOTEL_CONTAIER=edu_ihotel_hotel
IPAYMENT_CONTAINER=edu_ihotel_payment
connect_to_jennifer() {
echo "Connecting you to JENNIFER Server"
docker exec -ti $SERVER_CONTAINER sh
}
connect_to_ihotel() {
echo "Connecting you to iHotel"
docker exec -ti $IHOTEL_CONTAIER sh
}
connect_to_ipayment() {
echo "Connecting you to iPayment"
docker exec -ti $IPAYMENT_CONTAINER sh
}
echo "Select a container to connect to (Enter 1,2,3 or 4 for your choice)"
PS3='Please enter your choice: '
options=("JENNIFER Server" "iHotel Container" "iPayment and iCheck" "Quit")
select opt in "${options[@]}"
do
case $opt in
"JENNIFER Server")
connect_to_jennifer
;;
"iHotel Container")
connect_to_ihotel
;;
"iPayment and iCheck")
connect_to_ipayment
;;
"Quit")
echo "Bye!"
break
;;
*) echo "invalid option $REPLY";;
esac
done