buildpack/script/server.sh

27 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/sh
2019-11-30 18:05:23 +00:00
# The alive checker and Minecraft server is started at the same time. For performance reasons, the
# OpenJ9 JVM is used instead of Java's default Hotspot JVM.
2020-01-05 01:15:44 +00:00
mkdir -p $HOME/plugins/Essentials/userdata/
chmod -R 500 $HOME/plugins/bStats/ $HOME/plugins/Essentials/userdata/ $HOME/plugins/PluginMetrics/
# Make certain files read-only
echo "[]" > banned-ips.json
echo "[]" > banned-players.json
echo "[]" > ops.json
echo "[]" > whitelist.json
chmod 400 banned-ips.json
chmod 400 banned-players.json
chmod 400 ops.json
chmod 400 whitelist.json
2019-11-30 18:57:33 +00:00
dtach -n alivecheck $HOME/script/alivecheck.sh
2019-11-30 18:05:23 +00:00
while true; do
2019-12-30 15:55:53 +00:00
java -Xmx384M -Xtune:virtualized -Xaggressive -Xcompressedrefs -Xdump:none -Xgc:concurrentScavenge -Xgc:dnssExpectedTimeRatioMaximum=3 -Xgc:scvNoAdaptiveTenure -Xdisableexplicitgc -Xshareclasses -Xshareclasses:noPersistentDiskSpaceCheck -XX:-HeapDumpOnOutOfMemoryError -XX:OnOutofMemoryError="pkill -9 java" -XX:MaxDirectMemorySize=64M -XX:+UseContainerSupport -Dpaper.playerconnection.keepalive=360 -DIReallyKnowWhatIAmDoingISwear -jar server.jar
sleep 1
done