mirror of
https://github.com/kaboomserver/buildpack.git
synced 2024-09-28 19:23:01 +00:00
33 lines
1.7 KiB
Bash
Executable file
33 lines
1.7 KiB
Bash
Executable file
#!/bin/bash
|
|
mkdir -p crash-reports/ dumps/
|
|
touch banned-ips.json banned-ips.json.backup banned-players.json banned-players.json.backup ops.json ops.json.backup usercache.json whitelist.json whitelist.json.backup
|
|
echo "$PRIVATE_KEY" > .ssh/id_rsa
|
|
chmod 400 $(find . -type f)
|
|
chmod -R 500 crash-reports/ dumps/ plugins/bStats/ plugins/PluginMetrics/ plugins/ProtocolLib/ plugins/Updater/
|
|
chmod -R 755 reset/worlds/world/region/
|
|
rsync -Waqz -e "ssh -o StrictHostKeyChecking=no -T -c aes256-ctr -o Compression=no -x" --exclude-from="bin/excludes" serv@kaboom.pw:sync/ .
|
|
|
|
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
|
|
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
|
|
sleep 5
|
|
done &
|
|
|
|
while true; do
|
|
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
|
|
sleep 1
|
|
done &
|
|
|
|
while true; do
|
|
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 &
|
|
|
|
sleep infinity
|