cleanup code with variables for better access
This commit is contained in:
parent
71b1cc7924
commit
266d5b0bf0
@ -4,6 +4,8 @@
|
||||
# | bukkit-console by Elias Schriefer |
|
||||
# ×===================================×
|
||||
|
||||
server=""
|
||||
|
||||
if [ "$1" = "-h" ]
|
||||
then
|
||||
echo "bukkit-console [option]"
|
||||
@ -18,27 +20,27 @@ fi
|
||||
|
||||
# Get the bukkit server status: is it running or stopped?
|
||||
# We don't need echo, but thx anyways...
|
||||
bukkit-status > /dev/null
|
||||
$server-status > /dev/null
|
||||
if [ $? -gt 0 ]
|
||||
then
|
||||
# If the server is stopped, fukcing start it, man!
|
||||
bukkit-start
|
||||
$server-start
|
||||
fi
|
||||
if [ "$1" = "-f" ]
|
||||
then
|
||||
# Gimme the console
|
||||
sudo screen -xr bukkit
|
||||
sudo screen -xr $server
|
||||
# Now gimme my suxesvul eksid koud...
|
||||
true
|
||||
elif [ "$1" = "-ff" ]
|
||||
then
|
||||
# Hand me the console over
|
||||
sudo screen -dr bukkit
|
||||
sudo screen -dr $server
|
||||
# Now gimme my suxesvul eksid koud...
|
||||
true
|
||||
else
|
||||
# Gimme the console, plz...
|
||||
sudo screen -rq bukkit
|
||||
sudo screen -rq $server
|
||||
if [ $? -gt 0 ]
|
||||
then
|
||||
# If the console is attached elsewhere, say it
|
||||
|
@ -4,6 +4,8 @@
|
||||
# | bukkit-start by Elias Schriefer |
|
||||
# ×=================================×
|
||||
|
||||
server=""
|
||||
|
||||
if [ "$1" = "-h" ]
|
||||
then
|
||||
echo "bukkit-start [option]"
|
||||
@ -15,14 +17,14 @@ fi
|
||||
|
||||
# Get the bukkit server status: is it running or stopped?
|
||||
# We don't need echo, but thx anyways...
|
||||
bukkit-status > /dev/null
|
||||
$server-status > /dev/null
|
||||
if [ $? -gt 0 ]
|
||||
then
|
||||
# If the server is stopped, go into the server directory, ...
|
||||
cd /media/games/bukkit/
|
||||
cd /media/games/$server/
|
||||
# start the screen with Socket name & title "bukkit"
|
||||
# and run the start script
|
||||
sudo screen -dmS bukkit -t bukkit ./Start.sh
|
||||
sudo screen -dmS $server -t $server ./start.sh
|
||||
# Now gimme my suxesvul eksit koud...
|
||||
true
|
||||
else
|
||||
|
@ -4,6 +4,8 @@
|
||||
# | bukkit-status by Elias Schriefer |
|
||||
# ×==================================×
|
||||
|
||||
server=""
|
||||
|
||||
if [ "$1" = "-h" ]
|
||||
then
|
||||
echo "bukkit-status [option]"
|
||||
@ -15,7 +17,7 @@ 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
|
||||
sudo screen -ls $server > /dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
# If the screen window is indeed running, shout it in my
|
||||
|
Loading…
Reference in New Issue
Block a user