-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinitvm.bash
25 lines (24 loc) · 1.05 KB
/
initvm.bash
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
#!/bin/bash
# Run this inside the docker to install the needed docker, wireguard, etc.
#
#
docker ps >/dev/null #Are we starting on a machine without docker?
if [ $? -ne 0 ]; then # Yes - install all assuming an ubuntu instance
echo `date` VM ready to run darp;sudo apt-get update;
sudo apt install -y docker.io;
sudo systemctl start docker;
sudo systemctl enable docker;
sudo groupadd docker;
sudo usermod -aG docker ${USER};
sudo docker system prune -af;
echo "" | sudo add-apt-repository ppa:wireguard/wireguard;
sudo apt-get update; sudo apt-get install -y wireguard;
sudo groupadd docker;sudo usermod -aG docker ${USER};
sudo docker system prune -af;
sudo apt-get -y autoremove; echo `date`" REBOOTING";
echo "Relogin and docker is ready to run DARP by typing "
DARP_VERSION=`ls Docker.??????.????`
DARP_BASE_PORT=65013
echo "docker run -p$DARP_BASE_PORT:$DARP_BASE_PORT/udp -p$DARP_BASE_PORT:$DARP_BASE_PORT/tcp -eMY_GEO="'`hostname` '"williambnorton/darp:$DARP_VERSION"
sudo reboot
fi