-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
59 lines (42 loc) · 1.54 KB
/
Copy pathsetup.sh
File metadata and controls
59 lines (42 loc) · 1.54 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
command_exists() {
command -v "$@" >/dev/null 2>&1
}
echo "Setup IoT environment"
echo "Create default folders"
bash ./scripts/dirFixSetup.sh
echo "Update and upgrade sources"
sudo apt update && sudo apt full-upgrade && sudo rpi-update -y ;
echo "Install rclone"
curl https://rclone.org/install.sh | sudo bash
echo "After setup, configure offsite backups with: just setup-rclone"
echo "Install just (command runner) if missing"
if ! command_exists just; then
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin
fi
echo "Install Packages (git, build-essential, python3, python3-pip gcc, libffi-dev, libssl-dev, python3-dev)"
PACKAGES="git build-essential python3 python3-pip gcc libffi-dev libssl-dev python3-dev"
sudo apt install $PACKAGES -qy
echo "Install Docker and Docker-Compose"
if command_exists docker; then
echo "Docker already installed" >&2
else
echo "Install Docker" >&2
curl -fsSL https://get.docker.com | sh
RESTART_REQUIRED="true"
sudo usermod -aG docker $(id -un)
fi
if command_exists docker-compose; then
echo "docker-compose already installed" >&2
else
echo "Install docker-compose" >&2
RESTART_REQUIRED="true"
sudo apt install -y docker-compose
sudo usermod -aG docker $(id -un)
fi
echo "Setup finished"
if [ "$RESTART_REQUIRED" == "true" ]; then
if (whiptail --title "Restart Required" --yesno "It is recommended that you restart your device now. Select yes to do so now" 20 78); then
sudo reboot
fi
fi