-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathAxelarMenu.sh
55 lines (49 loc) · 1.32 KB
/
AxelarMenu.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
#!/bin/bash
sudo apt update > /dev/null 2>&1
REQUIRED_PKG="dialog"
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed")
echo Checking for $REQUIRED_PKG: $PKG_OK
if [ "" = "$PKG_OK" ]; then
echo "No $REQUIRED_PKG. Setting up $REQUIRED_PKG."
sudo apt-get --yes install $REQUIRED_PKG
fi
SCRIPT=`realpath -s $0`
SCRIPTPATH=`dirname $SCRIPT`
HEIGHT=17
WIDTH=60
CHOICE_HEIGHT=17
BACKTITLE="Axelar"
TITLE="Install menu"
MENU="Choose one of the following options:"
OPTIONS=(1 "Install Binary by systemd"
2 "Upgrade Binary by systemd"
3 "Create validator systemd"
4 "reboot node"
5 "Monitor the node via cli wrapper"
6 "Exit menu")
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
--title "$TITLE" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
clear
case $CHOICE in
1)
bash $SCRIPTPATH/binaryinstallsystemd.sh
;;
2)
bash $SCRIPTPATH/Upgradebinarysystemd.sh
;;
3)
bash $SCRIPTPATH/createvalidatorsystemd.sh
;;
4)
bash $SCRIPTPATH/rebootserver.sh
;;
5)
bash $SCRIPTPATH/monitoring/nodemonitor_binanry.sh
;;
6) exit
esac