forked from kj89/cosmos_node_monitoring
-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_monitoring.sh
61 lines (48 loc) · 2.75 KB
/
install_monitoring.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
#!/bin/bash
echo "=================================================="
echo -e "\033[0;35m"
echo " ::: ::: ::::::::::: :::: ::: :::::::: ::::::::: :::::::::: :::::::: ";
echo " :+: :+: :+: :+:+: :+: :+: :+: :+: :+: :+: :+: :+: ";
echo " +:+ +:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ ";
echo " +#++:++ +#+ +#+ +:+ +#+ +#+ +:+ +#+ +:+ +#++:++# +#++:++#++ ";
echo " +#+ +#+ +#+ +#+ +#+#+# +#+ +#+ +#+ +#+ +#+ +#+ ";
echo " #+# #+# #+# #+# #+# #+#+# #+# #+# #+# #+# #+# #+# #+# ";
echo " ### ### ##### ### #### ######## ######### ########## ######## ";
echo -e "\e[0m"
echo "=================================================="
sleep 2
echo -e "\e[1m\e[32m1. Updating dependencies... \e[0m" && sleep 1
sudo apt-get update
echo "=================================================="
echo -e "\e[1m\e[32m2. Installing required dependencies... \e[0m" && sleep 1
sudo apt install jq -y
sudo apt install python3-pip -y
sudo pip install yq
echo "=================================================="
echo -e "\e[1m\e[32m3. Checking if Docker is installed... \e[0m" && sleep 1
if ! command -v docker &> /dev/null
then
echo -e "\e[1m\e[32m3.1 Installing Docker... \e[0m" && sleep 1
sudo apt-get install ca-certificates curl gnupg lsb-release wget -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
sudo chmod a+r /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
fi
echo "=================================================="
echo -e "\e[1m\e[32m4. Checking if Docker Compose is installed ... \e[0m" && sleep 1
docker-compose version
if [ $? -ne 0 ]
then
echo -e "\e[1m\e[32m4.1 Installing Docker Compose... \e[0m" && sleep 1
docker_compose_version=$(wget -qO- https://api.github.com/repos/docker/compose/releases/latest | jq -r ".tag_name")
sudo wget -O /usr/bin/docker-compose "https://github.com/docker/compose/releases/download/${docker_compose_version}/docker-compose-`uname -s`-`uname -m`"
sudo chmod +x /usr/bin/docker-compose
fi
echo "=================================================="
echo -e "\e[1m\e[32m5. Downloading Node Monitoring config files ... \e[0m" && sleep 1
cd $HOME
rm -rf cosmos_node_monitoring
git clone https://github.com/kj89/cosmos_node_monitoring.git
chmod +x $HOME/cosmos_node_monitoring/add_validator.sh