This repository has been archived by the owner on Aug 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathrun.sh
executable file
·68 lines (60 loc) · 1.5 KB
/
run.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
#!/bin/bash
cd $(dirname -- "$0")
exec_path=$(pwd)
if ! command -v dialog &> /dev/null
then
echo "dialog could not be found. Installing dialog"
if [[ $OSTYPE == 'darwin'* ]]; then
brew install dialog
else
sudo apt install dialog -y
fi
fi
HEIGHT=16
WIDTH=40
CHOICE_HEIGHT=8
BACKTITLE="Script Options"
TITLE="Diva Alpha testnet"
MENU="Select one of the following options:"
OPTIONS=(1 "Install Diva"
2 "Update Diva"
3 "Start all containers"
4 "Stop all containers"
5 "Restart Diva container"
6 "Install docker"
7 "Wipe all docker containers and images"
8 "Edit environment variables")
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
--title "$TITLE" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
clear
case $CHOICE in
1)
./scripts/install-diva.sh $exec_path
;;
2)
./scripts/cmd/update-diva.sh $exec_path
;;
3)
./scripts/cmd/start-all.sh $exec_path
;;
4)
./scripts/cmd/stop-all.sh $exec_path
;;
5)
./scripts/cmd/restart-diva.sh $exec_path
;;
6)
./scripts/install-docker.sh
;;
7)
./scripts/wipe-dockers.sh
;;
8)
echo "Not implemented"
;;
esac