-
Notifications
You must be signed in to change notification settings - Fork 1
/
install-server.sh
48 lines (40 loc) · 1.87 KB
/
install-server.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
#!/usr/bin/env bash
## Dependencies installation
echo "Dependencies installation"
sudo apt-get install -y software-properties-common apparmor-utils apt-transport-https avahi-daemon ca-certificates curl dbus jq network-manager socat
sudo apt autoremove -y
## Disabling ModemManager (if exist) for compatibility
echo "Disabling ModemManager (if exist) for compatibility"
sudo systemctl disable ModemManager
sudo systemctl stop ModemManager
## Install Docker CE
command -v docker > /dev/null 2>&1 || dockerMissing=true
if [ "${dockerMissing}" = true ]
then
echo "Install Docker CE"
curl -fsSL get.docker.com | sudo sh
fi
## Install Supervised Home ASsistant
echo "Install Supervised Home ASsistant"
curl -sL "https://raw.githubusercontent.com/Kanga-Who/home-assistant/master/supervised-installer.sh" | sudo bash -s -- -m odroid-n2
## Docker-compose installation as a docker container
echo "Docker-compose installation as a docker container"
sudo curl -L --fail https://raw.githubusercontent.com/linuxserver/docker-docker-compose/master/run.sh -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
cd ~
homeDir=$(pwd)
## Creation of the services' dir
echo "Creation of the services' dir"
if [ ! -d "${homeDir}/.services" ]
then
mkdir ~/.services
fi
cd ~/.services
## Importing and setting docker-compose.yml
echo "Importing and setting docker-compose.yml"
>"${homeDir}/.services/docker-compose.yml" curl -sL "https://raw.githubusercontent.com/Ryther/homeserver/master/docker-compose.yml"
sed -i 's|{homeDir}|'"${homeDir}"'|' "${homeDir}/.services/docker-compose.yml"
read -p "Enter transmission username: " transmissionUsername
sed -i 's|{transmissionUsername}|'"${transmissionUsername}"'|' "${homeDir}/docker-compose.yml"
read -p "Enter transmission password: " transmissionPassword
sed -i 's|{transmissionPassword}|'"${transmissionPassword}"'|' "${homeDir}/docker-compose.yml"