From 345d8c8b25684e980f426d2a7c98032251013247 Mon Sep 17 00:00:00 2001 From: Adolfo Delorenzo Date: Wed, 20 Dec 2023 11:08:36 -0600 Subject: [PATCH] updates --- gen_random.sh | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/gen_random.sh b/gen_random.sh index c71749e..279f127 100755 --- a/gen_random.sh +++ b/gen_random.sh @@ -1,30 +1,19 @@ #!/usr/bin/bash random=`date | md5sum | awk '{print $1}' | cut -c 22-` -echo $random - -# Generate Game container -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 - -# Generate docker compose file -echo $random > /tmp/random -export VAR=`cat /tmp/random` -envsubst < template-wg_server.yaml > $random-wg_server.yaml -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 -rm ${random}-wg_server.yaml - -# Deploy the game server +# echo $random # CSGO2 server csgo2() { lxc launch --project $random -p default ubuntu:22.04 $random-csgo2 --network vn-$random > /dev/null; } # Minecraft server -minecraft() { lxc launch --project $random -p default minecraft-server $random-minecraft --network vn-$random; } +minecraft() { + 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 minecraft-server $random-minecraft --network vn-$random + } # Apex server apex() { lxc launch --project $random -p default ubuntu:22.04 $random-apex --network vn-$random > /dev/null; } @@ -34,3 +23,12 @@ rust() { lxc launch --project $random -p default ubuntu:22.04 $random-rust --net # GTA server gta() { lxc launch --project $random -p default ubuntu:22.04 $random-gta --network vn-$random > /dev/null; } + +# Generate docker compose file +echo $random > /tmp/random +export VAR=`cat /tmp/random` +envsubst < template-wg_server.yaml > $random-wg_server.yaml +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 +rm ${random}-wg_server.yaml