From 04afe129b01f856309fb6a8cf20ac6a0dd3688f4 Mon Sep 17 00:00:00 2001 From: Adolfo Delorenzo Date: Wed, 20 Dec 2023 13:41:21 -0600 Subject: [PATCH] servers added --- gen_random.sh | 89 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 76 insertions(+), 13 deletions(-) diff --git a/gen_random.sh b/gen_random.sh index b391ada..724592d 100755 --- a/gen_random.sh +++ b/gen_random.sh @@ -1,29 +1,92 @@ #!/bin/bash random=`date | md5sum | awk '{print $1}' | cut -c 22-` -# echo $random +echo $random -# CSGO2 server -csgo2() { lxc launch --project $random -p default ubuntu:22.04 $random-csgo2 --network vn-$random > /dev/null; } - -# Minecraft server -minecraft() { - echo "Minecraft function" +# 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 minecraft-server $random-minecraft --network vn-$random + lxc launch --project $random -p default csgo2-server $random-csgo2-std --network vn-$random --config limits.cpu=2 --config limits.memory=2048MiB > /dev/null } -# Apex server -apex() { lxc launch --project $random -p default ubuntu:22.04 $random-apex --network vn-$random > /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 + } -# Rust server -rust() { lxc launch --project $random -p default ubuntu:22.04 $random-rust --network vn-$random > /dev/null; } +# Minecraft servers +minecraft-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 minecraft-server $random-minecraft-std --network vn-$random --config limits.cpu=2 --config limits.memory=2048MiB > /dev/null + } + +minecraft-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 minecraft-server $random-minecraft-max --network vn-$random --config limits.cpu=4 --config limits.memory=4096MiB > /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() { lxc launch --project $random -p default ubuntu:22.04 $random-gta --network vn-$random > /dev/null; } +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 +} # Generate docker compose file echo $random > /tmp/random