From 6306400738748155e5f5075ff1250252d77e9825 Mon Sep 17 00:00:00 2001 From: erik Date: Tue, 29 Dec 2020 12:21:46 +0100 Subject: [PATCH] initial commit (uploading from fujitsu-server) --- README.md | 0 csgo-console | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ csgo-start | 44 +++++++++++++++++++++++++++++++++++++++ csgo-status | 34 ++++++++++++++++++++++++++++++ 4 files changed, 137 insertions(+) create mode 100644 README.md create mode 100755 csgo-console create mode 100755 csgo-start create mode 100755 csgo-status diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/csgo-console b/csgo-console new file mode 100755 index 0000000..f97b68e --- /dev/null +++ b/csgo-console @@ -0,0 +1,59 @@ +#!/bin/bash + +# ×===================================× +# | bukkit-console by Elias Schriefer | +# ×===================================× + +if [ "$1" = "-h" ] +then + echo "bukkit-console [option]" + echo + echo "Options:" + echo "Option for start of csgo server" + csgo-start -h + echo + echo + echo "Option for console connection" + echo " -h Show help" + echo " -f Get screen even if it is" + echo " already attached" + echo " -ff Same as -f but detach it first" + exit 0 +fi + +# Get the bukkit server status: is it running or stopped? +# We don't need echo, but thx anyways... +csgo-status > /dev/null +if [ $? -gt 0 ] +then + # If the server is stopped, fukcing start it, man! + csgo-start "$1" +fi +if [ "$2" = "-f" ] +then + # Gimme the console + sudo -u steam screen -xr csgo + # Now gimme my suxesvul eksid koud... + true +elif [ "$2" = "-ff" ] +then + # Hand me the console over + sudo -u steam screen -dr csgo + # Now gimme my suxesvul eksid koud... + true +else + # Gimme the console, plz... + sudo -u steam screen -rq csgo + if [ $? -gt 0 ] + then + # If the console is attached elsewhere, say it + echo Console is already in use + # Now gimme my suxesvul eksit koud... + false + else + # or my unsuxesvul eksid koud... + true + fi +fi +# and eksid wif that eksid koud +exit $? diff --git a/csgo-start b/csgo-start new file mode 100755 index 0000000..f0ccb22 --- /dev/null +++ b/csgo-start @@ -0,0 +1,44 @@ +#!/bin/bash + +# ×=================================× +# | bukkit-start by Elias Schriefer | +# ×=================================× + +if [ "$1" = "-h" ] +then + echo "bukkit-start [option]" + echo + echo "Options:" + echo " -h Show help" + echo " -D starts Death Mach" + echo " -d starts Demolition" + echo "-C starts Classic Casual" + exit 0 +fi + +# Get the bukkit server status: is it running or stopped? +# We don't need echo, but thx anyways... +csgo-status > /dev/null +if [ $? -gt 0 ] +then +cd /home/steam/ +sudo -u steam ./steamcmd.sh +login anonymous +force_install_dir /media/games/steamgames +app_update 740 +quit +cd /media/games/steamgames + + + case "$1" in + + -D) sudo -u steam screen -dmS csgo ./srcds_run -game csgo -console -usercon +game_type 1 +game_mode 2 +mapgroup mg_allclassic +map de_dust + true + ;; + -d) sudo -u steam screen -dmS csgo ./srcds_run -game csgo -console -usercon +game_type 1 +game_mode 1 +mapgroup mg_demolition +map de_lake + true + ;; + -C) sudo -u steam screen -dmS csgo ./srcds_run -game csgo -console -usercon +game_type 0 +game_mode 0 +mapgroup mg_active +map de_dust2 +esac +else + # or my unsuxesvul eksit koud... + false +fi +# and eksit wif that eksit koud +exit $? diff --git a/csgo-status b/csgo-status new file mode 100755 index 0000000..1a66dd1 --- /dev/null +++ b/csgo-status @@ -0,0 +1,34 @@ +#!/bin/bash + +# ×==================================× +# | bukkit-status by Elias Schriefer | +# ×==================================× + +if [ "$1" = "-h" ] +then + echo "bukkit-status [option]" + echo + echo "Options:" + echo " -h Show help" + exit 0 +fi + +# Is there a window with name "csgo" already running in screen? +# We don't need your fukcing text, ew... +sudo -u steam screen -ls csgo > /dev/null +if [ $? -eq 0 ] +then + # If the screen window is indeed running, shout it in my + # face, I wanna know... + echo running + # Now gimme my suxesvul eksit koud... + true +else + # If the screen window is not running, shout that in my + # face, too, I wanna know... + echo stopped + # Gimme my unsuxesvul eksid koud... + false +fi +# and eksit wif that eksid koud +exit $?