From 2ee90bf32e7ef60059c2bf4bcf9a70b1f66e1cde Mon Sep 17 00:00:00 2001 From: adelorenzo Date: Thu, 4 Jan 2024 00:06:40 +0100 Subject: [PATCH] Thu Jan 4 12:06:40 AM CET 2024 --- gen_random.sh | 70 +--------------------------------------------- random_numbers.db | Bin 8192 -> 8192 bytes 2 files changed, 1 insertion(+), 69 deletions(-) diff --git a/gen_random.sh b/gen_random.sh index 3fd3589..c5cf591 100755 --- a/gen_random.sh +++ b/gen_random.sh @@ -3,23 +3,6 @@ random=`date | md5sum | awk '{print $1}' | cut -c 22-` echo $random -# CSGO2 servers -csgo2-std() { - lxc project create $random -c features.images=false > /dev/null - lxc project switch $random > /dev/null - lxc --project $random network create vn-$random > /dev/null - cat /root/default.profile | lxc --project $random profile edit default > /dev/null - lxc launch --project $random -p default csgo2-server $random-csgo2-std --network vn-$random --config limits.cpu=2 --config limits.memory=2048MiB > /dev/null - } - -csgo2-max() { - lxc project create $random -c features.images=false > /dev/null - lxc project switch $random > /dev/null - lxc --project $random network create vn-$random > /dev/null - cat /root/default.profile | lxc --project $random profile edit default > /dev/null - lxc launch --project $random -p default csgo2-server $random-csgo2-max --network vn-$random --config limits.cpu=4 --config limits.memory=4096MiB > /dev/null - } - # Minecraft servers minecraft-std() { lxc project create $random -c features.images=false > /dev/null @@ -39,60 +22,9 @@ minecraft-max() { lxc launch --project $random -p default wireguard-server $random-vpn-server --network vn-$random --config limits.cpu=1 --config limits.memory=1024MiB > /dev/null } -# Apex servers -apex-std() { - lxc project create $random -c features.images=false > /dev/null - lxc project switch $random > /dev/null - lxc --project $random network create vn-$random > /dev/null - cat /root/default.profile | lxc --project $random profile edit default > /dev/null - lxc launch --project $random -p default apex-server $random-apex-std --network vn-$random --config limits.cpu=2 --config limits.memory=2048MiB > /dev/null -} - -apex-max() { - lxc project create $random -c features.images=false > /dev/null - lxc project switch $random > /dev/null - lxc --project $random network create vn-$random > /dev/null - cat /root/default.profile | lxc --project $random profile edit default > /dev/null - lxc launch --project $random -p default apex-server $random-apex-max --network vn-$random --config limits.cpu=4 --config limits.memory=4096MiB > /dev/null -} - -# Rust servers -rust-std() { - lxc project create $random -c features.images=false > /dev/null - lxc project switch $random > /dev/null - lxc --project $random network create vn-$random > /dev/null - cat /root/default.profile | lxc --project $random profile edit default > /dev/null - lxc launch --project $random -p default rust-server $random-rust-std --network vn-$random --config limits.cpu=2 --config limits.memory=2048MiB > /dev/null -} - -rust-max() { - lxc project create $random -c features.images=false > /dev/null - lxc project switch $random > /dev/null - lxc --project $random network create vn-$random > /dev/null - cat /root/default.profile | lxc --project $random profile edit default > /dev/null - lxc launch --project $random -p default rust-server $random-rust-max --network vn-$random --config limits.cpu=4 --config limits.memory=4096MiB > /dev/null -} - -# GTA server -gta-std() { - lxc project create $random -c features.images=false > /dev/null - lxc project switch $random > /dev/null - lxc --project $random network create vn-$random > /dev/null - cat /root/default.profile | lxc --project $random profile edit default > /dev/null - lxc launch --project $random -p default gta-server $random-gta-std --network vn-$random --config limits.cpu=2 --config limits.memory=2048MiB > /dev/null -} - -gta-max() { - lxc project create $random -c features.images=false > /dev/null - lxc project switch $random > /dev/null - lxc --project $random network create vn-$random > /dev/null - cat /root/default.profile | lxc --project $random profile edit default > /dev/null - 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/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 +lxc config device add $random-vpn-server udp$vpn_port proxy listen=udp:0.0.0.0:$vpn_port connect=udp:127.0.0.1:51820 curl --silent -X PUT --user "adelorenzo:dimi2014" https://couchdb.oe74.cloud/kk_users/${random}/${random} -d "{"_id":"$random"}" > /dev/null random_rev=`curl --silent -X GET https://adelorenzo:dimi2014@couchdb.oe74.cloud/kk_users/$random | jq -c '._rev' | sed 's/^.//' | sed 's/.$//'` #curl --silent -H "Content-Type: text/x-yaml" -X PUT --data-binary @${random}-wg_server.yaml --user "adelorenzo:dimi2014" "https://couchdb.oe74.cloud/kk_users/${random}/${random}-wg_server.yaml?rev=$random_rev" > /dev/null diff --git a/random_numbers.db b/random_numbers.db index 97077d7e4d0b2743914af7f4bcf1e09341628c26..c649f23de2dbb1572cb0e165647a76cca8d51d8a 100644 GIT binary patch delta 88 zcmZp0XmFSy%_ulg#+gxYW5N=C6#@PR2L2!XANXJJKj6Q?e}Vr5{{j9T{2TaJ@Gsz> p!9Rh&gTG<3p+E$`1e*Xe12e+0f6cqOW