commit e5853fab5a7169ff5aab21acfe9adfdda699f4bc Author: erik Date: Tue Dec 29 12:17:11 2020 +0100 initial commit (uploading from fujitsu-server) diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/bukkit-console b/bukkit-console new file mode 100755 index 0000000..ce0e665 --- /dev/null +++ b/bukkit-console @@ -0,0 +1,54 @@ +#!/bin/bash + +# ×===================================× +# | bukkit-console by Elias Schriefer | +# ×===================================× + +if [ "$1" = "-h" ] +then + echo "bukkit-console [option]" + echo + echo "Options:" + 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... +bukkit-status > /dev/null +if [ $? -gt 0 ] +then + # If the server is stopped, fukcing start it, man! + bukkit-start +fi +if [ "$1" = "-f" ] +then + # Gimme the console + sudo screen -xr bukkit + # Now gimme my suxesvul eksid koud... + true +elif [ "$1" = "-ff" ] +then + # Hand me the console over + sudo screen -dr bukkit + # Now gimme my suxesvul eksid koud... + true +else + # Gimme the console, plz... + sudo screen -rq bukkit + 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/bukkit-start b/bukkit-start new file mode 100755 index 0000000..b189646 --- /dev/null +++ b/bukkit-start @@ -0,0 +1,33 @@ +#!/bin/bash + +# ×=================================× +# | bukkit-start by Elias Schriefer | +# ×=================================× + +if [ "$1" = "-h" ] +then + echo "bukkit-start [option]" + echo + echo "Options:" + echo " -h Show help" + exit 0 +fi + +# Get the bukkit server status: is it running or stopped? +# We don't need echo, but thx anyways... +bukkit-status > /dev/null +if [ $? -gt 0 ] +then + # If the server is stopped, go into the server directory, ... + cd /media/games/bukkit/ + # start the screen with Socket name & title "bukkit" + # and run the start script + sudo screen -dmS bukkit -t bukkit ./Start.sh + # Now gimme my suxesvul eksit koud... + true +else + # or my unsuxesvul eksit koud... + false +fi +# and eksit wif that eksit koud +exit $? diff --git a/bukkit-status b/bukkit-status new file mode 100755 index 0000000..39cbd8f --- /dev/null +++ b/bukkit-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 "bukkit" already running in screen? +# We don't need your fukcing text, ew... +sudo screen -ls bukkit > /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 $?