2020-04-16 15:08:07 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-08-02 09:39:00 -04:00
|
|
|
# The alive checker and Minecraft server is started at the same time
|
2020-04-16 15:08:07 -04:00
|
|
|
|
|
|
|
PATH="$HOME/framework/vendor/java/bin/:$PATH"
|
|
|
|
|
2020-08-02 09:39:00 -04:00
|
|
|
# Dump classes
|
|
|
|
java -Xshare:dump
|
|
|
|
|
2020-04-16 15:08:07 -04:00
|
|
|
# Make sure we're in the server folder, located in the home directory
|
|
|
|
cd ~/server/
|
|
|
|
|
|
|
|
while true; do
|
2020-08-02 07:51:56 -04:00
|
|
|
# Make certain files and folders read-only
|
|
|
|
|
2020-12-12 13:35:51 -05:00
|
|
|
mkdir debug/ dumps/ plugins/update/
|
2021-03-02 15:38:57 -05:00
|
|
|
chmod -R 500 debug/ dumps/ plugins/bStats/ plugins/PluginMetrics/ plugins/update/
|
2020-12-12 13:35:51 -05:00
|
|
|
chmod 500 plugins/
|
2020-08-02 07:51:56 -04:00
|
|
|
chmod 400 bukkit.yml
|
|
|
|
chmod 400 commands.yml
|
|
|
|
chmod 400 eula.txt
|
|
|
|
chmod 400 paper.yml
|
|
|
|
chmod 400 permissions.yml
|
|
|
|
chmod 400 server-icon.png
|
|
|
|
chmod 400 server.properties
|
|
|
|
chmod 400 spigot.yml
|
|
|
|
chmod 400 wepif.yml
|
|
|
|
|
|
|
|
# Start alive checker
|
|
|
|
|
|
|
|
dtach -n alivecheck ~/framework/script/alivecheck.sh
|
|
|
|
|
|
|
|
# Start Minecraft server
|
|
|
|
|
2020-08-02 08:17:00 -04:00
|
|
|
java \
|
2021-04-10 08:25:45 -04:00
|
|
|
-Xmx1700M \
|
2020-08-02 09:39:00 -04:00
|
|
|
-Xshare:on \
|
2020-08-02 08:17:00 -04:00
|
|
|
-Xss8M \
|
2020-08-02 13:14:02 -04:00
|
|
|
-XX:MaxDirectMemorySize=512M \
|
2020-08-02 08:17:00 -04:00
|
|
|
-XX:+UseContainerSupport \
|
|
|
|
-DPaper.IgnoreJavaVersion=true \
|
|
|
|
-Dpaper.playerconnection.keepalive=360 \
|
|
|
|
-DIReallyKnowWhatIAmDoingISwear \
|
|
|
|
-jar server.jar nogui
|
2020-08-02 07:51:56 -04:00
|
|
|
|
|
|
|
# Stop alive checker (will be started again on the next run)
|
|
|
|
|
2020-08-02 07:57:35 -04:00
|
|
|
pkill -9 alivecheck.sh
|
2020-08-02 07:51:56 -04:00
|
|
|
|
|
|
|
# Ensure we don't abuse the CPU in case of failure
|
2020-04-16 15:08:07 -04:00
|
|
|
sleep 1
|
|
|
|
done
|