diff --git a/gen_ports.py b/gen_ports.py index d3ec91a..056453c 100644 --- a/gen_ports.py +++ b/gen_ports.py @@ -36,4 +36,4 @@ def generate_unique_random(): return rand_num if __name__ == "__main__": - print("Unique random number: " + str(generate_unique_random())) + print(str(generate_unique_random())) diff --git a/gen_random.sh b/gen_random.sh index a7e8068..8ea3975 100755 --- a/gen_random.sh +++ b/gen_random.sh @@ -90,6 +90,10 @@ gta-max() { lxc launch --project $random -p default gta-server $random-gta-max --network vn-$random --config limits.cpu=4 --config limits.memory=4096MiB > /dev/null } +# Setup VPN +vpn_port=`python3 /opt/thekube/gen_ports.py` +lxc config device add ${random} udp$vpn_port proxy listen=udp:0.0.0.0:$vpn_port connect=udp:127.0.0.1:51820 + # Generate docker compose file #echo $random > /tmp/$random-random #export VAR=`cat /tmp/$random-random`