2021-03-21 14:04:57 +00:00
|
|
|
#!
|
2021-06-27 17:35:05 +00:00
|
|
|
|
|
|
|
#Pull in the .env file for variables.
|
|
|
|
source .env.sh
|
|
|
|
|
2021-03-21 14:04:57 +00:00
|
|
|
sleep 10
|
2021-06-27 17:35:05 +00:00
|
|
|
if screen -list | grep -q "$SCREEN_NAME";
|
2021-03-21 14:04:57 +00:00
|
|
|
then
|
2021-06-27 17:35:05 +00:00
|
|
|
screen -X -S "$SCREEN_NAME" stuff "stop^M"
|
2021-03-21 14:04:57 +00:00
|
|
|
sleep 5
|
|
|
|
fi
|
|
|
|
|
2021-06-27 17:35:05 +00:00
|
|
|
if screen -list | grep -q "$SCREEN_NAME";
|
2021-03-21 14:04:57 +00:00
|
|
|
then
|
2021-06-27 17:35:05 +00:00
|
|
|
screen -X -S "$SCREEN_NAME" stuff "^C"
|
2021-03-21 14:04:57 +00:00
|
|
|
sleep 5
|
|
|
|
fi
|
|
|
|
|
2021-06-27 17:35:05 +00:00
|
|
|
if screen -list | grep -q "$SCREEN_NAME";
|
2021-03-21 14:04:57 +00:00
|
|
|
then
|
2021-06-27 17:35:05 +00:00
|
|
|
screen -X -S "$SCREEN_NAME" stuff "^C^C^C^C^C^C^C^C"
|
2021-03-21 14:04:57 +00:00
|
|
|
fi
|
|
|
|
|
2021-06-27 17:35:05 +00:00
|
|
|
if screen -list | grep -q "$SCREEN_NAME";
|
2021-03-21 14:04:57 +00:00
|
|
|
then
|
|
|
|
echo "Graceful Shutdown Failed. Please run tf!kill"
|
|
|
|
fi
|
|
|
|
|
2021-06-27 17:35:05 +00:00
|
|
|
if screen -list | grep -q "$SCREEN_NAME";
|
2021-03-21 14:04:57 +00:00
|
|
|
then
|
|
|
|
echo "ERROR - We have been unable to re-start the server... Please execute this manually"
|
|
|
|
else
|
2021-06-27 17:48:41 +00:00
|
|
|
screen -dmS $SCREEN_NAME java -Xms$JVM_HEAP -Xmx$JVM_HEAP $JVM_LAUNCH_OPTS -jar $PAPER_JAR_NAME
|
2021-03-21 14:04:57 +00:00
|
|
|
echo "Server Started"
|
|
|
|
fi
|