minecraft-bukkit-start-script/bukkit-console

55 lines
1.1 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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 $?