-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit_env.sh
executable file
·47 lines (42 loc) · 1.39 KB
/
init_env.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
#!/usr/bin/env bash
#sudo apt-get remove docker docker-engine docker.io containerd runc
#Check if Docker is installed
if [ ! -f "/usr/bin/docker" ]; then
#---------------
echo "update apt..."
sudo apt-get update
echo "[installing docker...]"
sudo apt-get install \
ca-certificates \
curl \
gnupg
echo "add docker GPG key..."
sudo mkdir -m 0755 -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
echo "update docker gpt..."
sudo apt update -y
sudo apt upgrade -y
echo "install docker Engine..."
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
echo "[docker install finished!!!]"
#-------------
else
echo "[Docker is installed]"
fi
echo "[start install certbot]"
sudo snap install core; sudo snap refresh core
echo "[installing certbot...]"
if [ ! -f "/snap/bin/certbot" ]; then
sudo snap install --classic certbot
else
echo "certbot installed"
if [ ! -f "/usr/bin/certbot" ]; then
echo "linking certbot"
sudo ln -s /snap/bin/certbot /usr/bin/certbot
fi
fi
sudo certbot certonly --standalone