2020-12-29 12:17:11 +01:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
# ×=================================×
|
|
|
|
|
# | bukkit-start by Elias Schriefer |
|
|
|
|
|
# ×=================================×
|
|
|
|
|
|
2022-01-02 18:51:34 +01:00
|
|
|
|
server=""
|
|
|
|
|
|
2020-12-29 12:17:11 +01:00
|
|
|
|
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...
|
2022-01-02 18:51:34 +01:00
|
|
|
|
$server-status > /dev/null
|
2020-12-29 12:17:11 +01:00
|
|
|
|
if [ $? -gt 0 ]
|
|
|
|
|
then
|
|
|
|
|
# If the server is stopped, go into the server directory, ...
|
2022-01-02 18:51:34 +01:00
|
|
|
|
cd /media/games/$server/
|
2020-12-29 12:17:11 +01:00
|
|
|
|
# start the screen with Socket name & title "bukkit"
|
|
|
|
|
# and run the start script
|
2022-01-02 18:51:34 +01:00
|
|
|
|
sudo screen -dmS $server -t $server ./start.sh
|
2020-12-29 12:17:11 +01:00
|
|
|
|
# Now gimme my suxesvul eksit koud...
|
|
|
|
|
true
|
|
|
|
|
else
|
|
|
|
|
# or my unsuxesvul eksit koud...
|
|
|
|
|
false
|
|
|
|
|
fi
|
|
|
|
|
# and eksit wif that eksit koud
|
|
|
|
|
exit $?
|