-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
59 lines (47 loc) · 1.84 KB
/
setup.sh
File metadata and controls
59 lines (47 loc) · 1.84 KB
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
#!/bin/bash
DOMAIN="msciacca.42.fr"
RED="\e[91m"
GREEN="\e[92m"
YELLOW="\e[93m"
BLUE="\e[94m"
PURPLE="\e[95m"
CYAN="\e[96m"
BLANK="\e[0m"
echo -e $PURPLE "Updating system..." $BLANK
sudo apt update 2> /dev/null
sudo apt upgrade -y 2> /dev/null
echo -e $GREEN "Done." $BLANK
echo -e $PURPLE "Installing git, make and vim..."
sudo apt install -y git make vim 2> /dev/null
echo -e $GREEN "Done." $BLANK
echo -e $PURPLE "Installing vscode..."
sudo snap install --classic code 2> /dev/null
echo -e $GREEN "Done." $BLANK
echo -e $PURPLE "Installing filezilla..."
sudo snap install --edge filezilla 2> /dev/null
echo -e $GREEN "Done." $BLANK
if grep -q $DOMAIN /etc/hosts; then
echo -e $PURPLE "Setting up $DOMAIN as localhost"
sudo echo "127.0.0.1 $DOMAIN" >> /etc/hosts
echo -e $GREEN "Done." $BLANK
fi
echo -e $PURPLE "Installing docker dependencies..."
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
echo -e $GREEN "Done."
echo -e $PURPLE "Installing docker..."
sudo apt-get remove -y docker.io docker-doc docker-compose podman-docker containerd runc
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg --insecure | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /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
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
echo -e $GREEN "Done."
echo -e $GREEN "Config completed. " $RED "Rebooting in 5 seconds..." $BLANK
sleep 5
sudo reboot