mirror of
https://github.com/TotalFreedomMC/TF-Scripts.git
synced 2024-12-23 00:15:10 +00:00
First stab at getting the scripts in a slightly better setup ready for future expansion work
This commit is contained in:
parent
cdeb526da4
commit
cdeff8c58c
5 changed files with 59 additions and 26 deletions
10
FreeOP Servers/.env.sh
Normal file
10
FreeOP Servers/.env.sh
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#!
|
||||||
|
|
||||||
|
# These ones should be server specific
|
||||||
|
JVM_HEAP="18G"
|
||||||
|
PAPER_JAR_NAME="paperclip.jar"
|
||||||
|
|
||||||
|
# DO NOT Change these ones
|
||||||
|
SCREEN_NAME="TotalFreedom"
|
||||||
|
SARCASTIC_MESSAGE="The server is not running... Why don't you try starting it? <3"
|
||||||
|
RESET_FILE=/home/tfserver/.resetting
|
|
@ -1,13 +1,17 @@
|
||||||
#!
|
#!
|
||||||
if screen -list | grep -q "TotalFreedom";
|
|
||||||
|
#Pull in the .env file for variables.
|
||||||
|
source .env.sh
|
||||||
|
|
||||||
|
if screen -list | grep -q "$SCREEN_NAME";
|
||||||
then
|
then
|
||||||
screen -X -S "TotalFreedom" stuff "^C^C^C^C^C^C^C^C^C^C^C^C^C"
|
screen -X -S "$SCREEN_NAME" stuff "^C^C^C^C^C^C^C^C^C^C^C^C^C"
|
||||||
sleep 5
|
sleep 5
|
||||||
else
|
else
|
||||||
echo "The server is not running... Try starting it <3"
|
echo "$SARCASTIC_MESSAGE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if screen -list | grep -q "TotalFreedom";
|
if screen -list | grep -q "$SCREEN_NAME";
|
||||||
then
|
then
|
||||||
fuser -k 25565/tcp
|
fuser -k 25565/tcp
|
||||||
rm -f /home/tfserver/world/session.lock
|
rm -f /home/tfserver/world/session.lock
|
||||||
|
@ -20,7 +24,7 @@ then
|
||||||
sleep 5
|
sleep 5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if screen -list | grep -q "TotalFreedom";
|
if screen -list | grep -q "$SCREEN_NAME";
|
||||||
then
|
then
|
||||||
echo "Kill Command Failed. Please try again"
|
echo "Kill Command Failed. Please try again"
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,31 +1,35 @@
|
||||||
#!
|
#!
|
||||||
|
|
||||||
|
#Pull in the .env file for variables.
|
||||||
|
source .env.sh
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
if screen -list | grep -q "TotalFreedom";
|
if screen -list | grep -q "$SCREEN_NAME";
|
||||||
then
|
then
|
||||||
screen -X -S "TotalFreedom" stuff "stop^M"
|
screen -X -S "$SCREEN_NAME" stuff "stop^M"
|
||||||
sleep 5
|
sleep 5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if screen -list | grep -q "TotalFreedom";
|
if screen -list | grep -q "$SCREEN_NAME";
|
||||||
then
|
then
|
||||||
screen -X -S "TotalFreedom" stuff "^C"
|
screen -X -S "$SCREEN_NAME" stuff "^C"
|
||||||
sleep 5
|
sleep 5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if screen -list | grep -q "TotalFreedom";
|
if screen -list | grep -q "$SCREEN_NAME";
|
||||||
then
|
then
|
||||||
screen -X -S "TotalFreedom" stuff "^C^C^C^C^C^C^C^C"
|
screen -X -S "$SCREEN_NAME" stuff "^C^C^C^C^C^C^C^C"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if screen -list | grep -q "TotalFreedom";
|
if screen -list | grep -q "$SCREEN_NAME";
|
||||||
then
|
then
|
||||||
echo "Graceful Shutdown Failed. Please run tf!kill"
|
echo "Graceful Shutdown Failed. Please run tf!kill"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if screen -list | grep -q "TotalFreedom";
|
if screen -list | grep -q "$SCREEN_NAME";
|
||||||
then
|
then
|
||||||
echo "ERROR - We have been unable to re-start the server... Please execute this manually"
|
echo "ERROR - We have been unable to re-start the server... Please execute this manually"
|
||||||
else
|
else
|
||||||
screen -dmS TotalFreedom java -Xms18G -Xmx18G -XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -jar paperclip.jar
|
screen -dmS $SCREEN_NAME java -Xms$JVM_HEAP -Xmx$JVM_HEAP -XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -jar $PAPER_JAR_NAME
|
||||||
echo "Server Started"
|
echo "Server Started"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,8 +1,19 @@
|
||||||
#!
|
#!
|
||||||
if screen -list | grep -q "TotalFreedom";
|
|
||||||
|
#Pull in the .env file for variables.
|
||||||
|
source .env.sh
|
||||||
|
|
||||||
|
if test -f "$RESET_FILE";
|
||||||
|
then
|
||||||
|
echo "CRITICAL ERORR - Server is currently re-setting. Please wait for this action to complete."
|
||||||
|
else
|
||||||
|
if screen -list | grep -q "$SCREEN_NAME";
|
||||||
then
|
then
|
||||||
echo "ERROR - There is an instance of the server already running. Make sure it is killed first and try again"
|
echo "ERROR - There is an instance of the server already running. Make sure it is killed first and try again"
|
||||||
else
|
else
|
||||||
screen -dmS TotalFreedom java -Xms18G -Xmx18G -XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -jar paperclip.jar
|
screen -dmS $SCREEN_NAME java -Xms$JVM_HEAP -Xmx$JVM_HEAP -XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -jar $PAPER_JAR_NAME
|
||||||
echo "Server Started"
|
echo "Server Started"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,25 @@
|
||||||
#!
|
#!
|
||||||
if screen -list | grep -q "TotalFreedom"; then
|
|
||||||
screen -X -S "TotalFreedom" stuff "stop^M"
|
#Pull in the .env file for variables.
|
||||||
|
source .env.sh
|
||||||
|
|
||||||
|
if screen -list | grep -q "$SCREEN_NAME"; then
|
||||||
|
screen -X -S "$SCREEN_NAME" stuff "stop^M"
|
||||||
sleep 5
|
sleep 5
|
||||||
if screen -list | grep -q "TotalFreedom"; then
|
if screen -list | grep -q "$SCREEN_NAME"; then
|
||||||
screen -X -S "TotalFreedom" stuff "^C"
|
screen -X -S "$SCREEN_NAME" stuff "^C"
|
||||||
sleep 5
|
sleep 5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if screen -list | grep -q "TotalFreedom"; then
|
if screen -list | grep -q "$SCREEN_NAME"; then
|
||||||
screen -X -S "TotalFreedom" stuff "^C^C^C^C^C^C^C^C"
|
screen -X -S "$SCREEN_NAME" stuff "^C^C^C^C^C^C^C^C"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if screen -list | grep -q "TotalFreedom"; then
|
if screen -list | grep -q "$SCREEN_NAME"; then
|
||||||
echo "Graceful Shutdown Failed. Please run tf!kill"
|
echo "Graceful Shutdown Failed. Please run tf!kill"
|
||||||
else
|
else
|
||||||
echo "Server has been shut down succesfully."
|
echo "Server has been shut down succesfully."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "The server is not running... Try starting it <3"
|
echo "$SARCASTIC_MESSAGE"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue