Added FreeOP Scripts

This is as they currently stand, I know there are better ways to have set these up but they've worked okay for now.
This commit is contained in:
Ryan Wild 2021-03-21 14:04:57 +00:00
parent aa9a68ba13
commit 4e71b18351
No known key found for this signature in database
GPG key ID: C224F5A8431F3F5C
6 changed files with 101 additions and 0 deletions

2
FreeOP Servers/README.md Normal file
View file

@ -0,0 +1,2 @@
# TF-Scripts
Various scripts we use to manage the TF Servers

28
FreeOP Servers/kill.sh Normal file
View file

@ -0,0 +1,28 @@
#!
if screen -list | grep -q "TotalFreedom";
then
screen -X -S "TotalFreedom" stuff "^C^C^C^C^C^C^C^C^C^C^C^C^C"
sleep 5
else
echo "The server is not running... Try starting it <3"
fi
if screen -list | grep -q "TotalFreedom";
then
fuser -k 25565/tcp
rm -f /home/tfserver/world/session.lock
rm -f /home/tfserver/flatlands/session.lock
rm -f /home/tfserver/hubworld/session.lock
rm -f /home/tfserver/masterbuilderworld/session.lock
rm -f /home/tfserver/plotworld/sesssion.lock
rm -f /home/tfserver/world_nether/session.lock
rm -f /home/tfserver/world_the_end/session.lock
sleep 5
fi
if screen -list | grep -q "TotalFreedom";
then
echo "Kill Command Failed. Please try again"
else
echo "Graceful Shutdown Complete! Yay TotalFreedom"
fi

View file

@ -0,0 +1,31 @@
#!
sleep 10
if screen -list | grep -q "TotalFreedom";
then
screen -X -S "TotalFreedom" stuff "stop^M"
sleep 5
fi
if screen -list | grep -q "TotalFreedom";
then
screen -X -S "TotalFreedom" stuff "^C"
sleep 5
fi
if screen -list | grep -q "TotalFreedom";
then
screen -X -S "TotalFreedom" stuff "^C^C^C^C^C^C^C^C"
fi
if screen -list | grep -q "TotalFreedom";
then
echo "Graceful Shutdown Failed. Please run tf!kill"
fi
if screen -list | grep -q "TotalFreedom";
then
echo "ERROR - We have been unable to re-start the server... Please execute this manually"
else
screen -dmS TotalFreedom java -Xms18G -Xmx18G -XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -jar paperclip.jar
echo "Server Started"
fi

View file

@ -0,0 +1,8 @@
#!
if screen -list | grep -q "jAgent";
then
echo "ERROR - There is already an instance of the agent running."
else
screen -dmS jAgent java -Xms2G -Xmx2G -jar jagent-1.0.jar
echo "Agent Started"
fi

8
FreeOP Servers/start.sh Normal file
View file

@ -0,0 +1,8 @@
#!
if screen -list | grep -q "TotalFreedom";
then
echo "ERROR - There is an instance of the server already running. Make sure it is killed first and try again"
else
screen -dmS TotalFreedom java -Xms18G -Xmx18G -XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -jar paperclip.jar
echo "Server Started"
fi

24
FreeOP Servers/stop.sh Normal file
View file

@ -0,0 +1,24 @@
#!
if screen -list | grep -q "TotalFreedom";
then
screen -X -S "TotalFreedom" stuff "stop^M"
sleep 5
else
echo "The server is not running... Try starting it <3"
fi
if screen -list | grep -q "TotalFreedom";
then
screen -X -S "TotalFreedom" stuff "^C"
sleep 5
fi
if screen -list | grep -q "TotalFreedom";
then
screen -X -S "TotalFreedom" stuff "^C^C^C^C^C^C^C^C"
fi
if screen -list | grep -q "TotalFreedom";
then
echo "Graceful Shutdown Failed. Please run tf!kill"
fi