mirror of
https://github.com/TotalFreedomMC/TF-Scripts.git
synced 2024-12-22 16:05:03 +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
|
||||
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
|
||||
else
|
||||
echo "The server is not running... Try starting it <3"
|
||||
echo "$SARCASTIC_MESSAGE"
|
||||
fi
|
||||
|
||||
if screen -list | grep -q "TotalFreedom";
|
||||
if screen -list | grep -q "$SCREEN_NAME";
|
||||
then
|
||||
fuser -k 25565/tcp
|
||||
rm -f /home/tfserver/world/session.lock
|
||||
|
@ -20,7 +24,7 @@ then
|
|||
sleep 5
|
||||
fi
|
||||
|
||||
if screen -list | grep -q "TotalFreedom";
|
||||
if screen -list | grep -q "$SCREEN_NAME";
|
||||
then
|
||||
echo "Kill Command Failed. Please try again"
|
||||
else
|
||||
|
|
|
@ -1,31 +1,35 @@
|
|||
#!
|
||||
|
||||
#Pull in the .env file for variables.
|
||||
source .env.sh
|
||||
|
||||
sleep 10
|
||||
if screen -list | grep -q "TotalFreedom";
|
||||
if screen -list | grep -q "$SCREEN_NAME";
|
||||
then
|
||||
screen -X -S "TotalFreedom" stuff "stop^M"
|
||||
screen -X -S "$SCREEN_NAME" stuff "stop^M"
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
if screen -list | grep -q "TotalFreedom";
|
||||
if screen -list | grep -q "$SCREEN_NAME";
|
||||
then
|
||||
screen -X -S "TotalFreedom" stuff "^C"
|
||||
screen -X -S "$SCREEN_NAME" stuff "^C"
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
if screen -list | grep -q "TotalFreedom";
|
||||
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
|
||||
|
||||
if screen -list | grep -q "TotalFreedom";
|
||||
if screen -list | grep -q "$SCREEN_NAME";
|
||||
then
|
||||
echo "Graceful Shutdown Failed. Please run tf!kill"
|
||||
fi
|
||||
|
||||
if screen -list | grep -q "TotalFreedom";
|
||||
if screen -list | grep -q "$SCREEN_NAME";
|
||||
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
|
||||
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"
|
||||
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 "ERROR - There is an instance of the server already running. Make sure it is killed first and try again"
|
||||
echo "CRITICAL ERORR - Server is currently re-setting. Please wait for this action to complete."
|
||||
else
|
||||
screen -dmS TotalFreedom java -Xms18G -Xmx18G -XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -jar paperclip.jar
|
||||
echo "Server Started"
|
||||
if screen -list | grep -q "$SCREEN_NAME";
|
||||
then
|
||||
echo "ERROR - There is an instance of the server already running. Make sure it is killed first and try again"
|
||||
else
|
||||
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"
|
||||
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
|
||||
if screen -list | grep -q "TotalFreedom"; then
|
||||
screen -X -S "TotalFreedom" stuff "^C"
|
||||
if screen -list | grep -q "$SCREEN_NAME"; then
|
||||
screen -X -S "$SCREEN_NAME" 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"
|
||||
if screen -list | grep -q "$SCREEN_NAME"; then
|
||||
screen -X -S "$SCREEN_NAME" stuff "^C^C^C^C^C^C^C^C"
|
||||
fi
|
||||
|
||||
if screen -list | grep -q "TotalFreedom"; then
|
||||
if screen -list | grep -q "$SCREEN_NAME"; then
|
||||
echo "Graceful Shutdown Failed. Please run tf!kill"
|
||||
else
|
||||
echo "Server has been shut down succesfully."
|
||||
fi
|
||||
else
|
||||
echo "The server is not running... Try starting it <3"
|
||||
echo "$SARCASTIC_MESSAGE"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue