buildpack/bin/start

34 lines
1.6 KiB
Plaintext
Raw Normal View History

2018-05-25 16:49:13 +00:00
#!/bin/bash
mkdir -p crash-reports/ dumps/
2018-06-10 14:44:27 +00:00
touch banned-ips.json banned-players.json ops.json usercache.json version_history.json whitelist.json
2018-06-10 11:38:18 +00:00
echo "$PRIVATE_KEY" > .ssh/id_rsa
2018-06-10 14:34:30 +00:00
chmod 400 $(find . ! -path "*/.*" -type f)
2018-06-10 14:01:27 +00:00
chmod -R 500 crash-reports/ dumps/ plugins/bStats/ plugins/PluginMetrics/ plugins/ProtocolLib/ plugins/Updater/
chmod -R 755 reset/worlds/world/region/
2018-06-10 11:38:18 +00:00
rsync -Waqz -e "ssh -o StrictHostKeyChecking=no -T -c aes256-ctr -o Compression=no -x" --exclude-from="bin/excludes" serv@kaboom.pw:sync/ .
2018-05-25 16:49:13 +00:00
if [ ! -d worlds/ ]; then
cp -r reset/worlds/ .
else
rm -rf worlds/world/region/
cp -r reset/worlds/world/region/ worlds/world/
fi
while true; do
2018-06-10 11:38:18 +00:00
rsync -Waq -e "ssh -o StrictHostKeyChecking=no -T -c aes256-ctr -o Compression=no -x" --exclude-from="bin/excludes" plugins worlds serv@kaboom.pw:sync/ > /dev/null 2>&1
2018-06-10 11:26:10 +00:00
sleep 5
2018-05-25 16:49:13 +00:00
done &
2018-06-10 09:27:51 +00:00
while true; do
2018-06-10 11:38:18 +00:00
ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -o ServerAliveCountMax=9999 -S none -N -T -R 64518:localhost:25565 serv@kaboom.pw > /dev/null 2>&1
2018-06-10 09:27:51 +00:00
sleep 1
done &
2018-05-25 16:49:13 +00:00
while true; do
2018-06-10 18:14:42 +00:00
ulimit -v 5300000
2018-05-25 16:49:13 +00:00
java -Xms300m -XX:MinHeapFreeRatio=1 -XX:MaxHeapFreeRatio=10 -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1HeapRegionSize=4M -XX:G1MixedGCLiveThresholdPercent=50 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:MaxGCPauseMillis=100 -XX:+AggressiveOpts -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:InitiatingHeapOccupancyPercent=10 -XX:TargetSurvivorRatio=90 -XX:+UseLargePagesInMetaspace -Dcom.mojang.eula.agree=true -Dlog4j.configurationFile=log4j2.xml -jar minecraft-server.jar --world-dir=worlds > /dev/null 2>&1
sleep 1
done &
2018-06-10 05:22:56 +00:00
sleep infinity