-
Notifications
You must be signed in to change notification settings - Fork 4
/
install.sh
44 lines (35 loc) · 1.28 KB
/
install.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
#!/bin/bash
install_path=${HOME}/FoundryServer
clone_repo() {
sudo git clone -b release --single-branch --depth=1 https://github.com/ShoyuVanilla/FoundryVTT-docker-compose ${install_path}
}
install_docker() {
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
sudo usermod -aG docker $USER
sudo curl -L "https://github.com/docker/compose/releases/download/1.28.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
}
open_ports() {
sudo iptables -I INPUT 5 -i ens3 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
sudo iptables -I INPUT 5 -i ens3 -p tcp --dport 8080 -m state --state NEW,ESTABLISHED -j ACCEPT
sudo iptables -I INPUT 5 -i ens3 -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
}
make_alias() {
if grep -q "# Foundry aliases" "${HOME}/.bashrc"; then
return
fi
sudo echo '' >> $HOME/.bashrc
sudo echo "# Foundry aliases" >> $HOME/.bashrc
sudo echo "if [ -f ${install_path}/.bash_aliases ]; then" >> $HOME/.bashrc
sudo echo " source ${install_path}/.bash_aliases" >> $HOME/.bashrc
sudo echo "fi" >> $HOME/.bashrc
bash
}
main() {
clone_repo
install_docker
open_ports || :
make_alias
}
main