52 lines
1.1 KiB
Bash
Executable file
52 lines
1.1 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
# The alive checker and Minecraft server is started at the same time
|
|
|
|
PATH="$HOME/framework/vendor/java/bin/:$PATH"
|
|
|
|
# Dump classes
|
|
java -Xshare:dump
|
|
|
|
# Make sure we're in the server folder, located in the home directory
|
|
cd ~/server/
|
|
|
|
while true; do
|
|
# Make certain files and folders read-only
|
|
|
|
chmod -R 500 plugins/bStats/
|
|
chmod -R 500 plugins/PluginMetrics/
|
|
chmod -R 500 plugins/ProtocolLib/
|
|
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
|
|
|
|
java \
|
|
-Xmx1800M \
|
|
-Xshare:on \
|
|
-Xss8M \
|
|
-XX:MaxDirectMemorySize=128M \
|
|
-XX:+UseContainerSupport \
|
|
-DPaper.IgnoreJavaVersion=true \
|
|
-Dpaper.playerconnection.keepalive=360 \
|
|
-DIReallyKnowWhatIAmDoingISwear \
|
|
-jar server.jar nogui
|
|
|
|
# Stop alive checker (will be started again on the next run)
|
|
|
|
pkill -9 alivecheck.sh
|
|
|
|
# Ensure we don't abuse the CPU in case of failure
|
|
sleep 1
|
|
done
|