2018-05-25 19:49:13 +03:00
|
|
|
#!/bin/bash
|
|
|
|
mkdir -p crash-reports/ dumps/
|
2018-06-10 21:36:45 +03:00
|
|
|
touch banned-ips.json banned-players.json ops.json usercache.json whitelist.json
|
2018-06-10 14:38:18 +03:00
|
|
|
echo "$PRIVATE_KEY" > .ssh/id_rsa
|
2018-07-11 06:52:20 +03:00
|
|
|
chmod 400 $(find . ! -path "*/.*" -type f)
|
2018-06-10 17:01:27 +03:00
|
|
|
chmod -R 500 crash-reports/ dumps/ plugins/bStats/ plugins/PluginMetrics/ plugins/ProtocolLib/ plugins/Updater/
|
2018-07-05 23:51:43 +03:00
|
|
|
|
2018-07-06 00:33:37 +03:00
|
|
|
if [ "$(ssh -o StrictHostKeyChecking=no -T -c aes256-ctr -o Compression=no -x serv@kaboom.pw 'du -s sync/worlds/' | awk '{print $1}')" -gt "500000" ]; then
|
2018-07-06 00:46:18 +03:00
|
|
|
ssh -o StrictHostKeyChecking=no serv@kaboom.pw 'cd sync/ && find . ! -path './plugins/WorldEdit/schematics' -type d -exec rm -rf {} +'
|
2018-07-05 23:51:43 +03:00
|
|
|
fi
|
2018-07-11 17:33:17 +03: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 19:49:13 +03:00
|
|
|
|
|
|
|
while true; do
|
2018-07-11 17:33:17 +03: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 14:26:10 +03:00
|
|
|
sleep 5
|
2018-05-25 19:49:13 +03:00
|
|
|
done &
|
|
|
|
|
2018-06-10 12:27:51 +03:00
|
|
|
while true; do
|
2018-06-10 14:38:18 +03: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 12:27:51 +03:00
|
|
|
sleep 1
|
|
|
|
done &
|
|
|
|
|
2018-07-11 17:10:41 +03:00
|
|
|
bin/tmux new -d -s server 'while true; do
|
2018-07-11 17:33:17 +03:00
|
|
|
.bin/java/bin/java -Xms0m -Xmx300m -Xss512k -XX:MinHeapFreeRatio=1 -XX:MaxHeapFreeRatio=10 -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:MaxGCPauseMillis=100 -XX:+AggressiveOpts -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:InitiatingHeapOccupancyPercent=10 -XX:TargetSurvivorRatio=90 -XX:-UseBiasedLocking -XX:+UseLargePagesInMetaspace -XX:+UseNUMA -XX:+UseTransparentHugePages -Dcom.mojang.eula.agree=true -Dlog4j.configurationFile=log4j2.xml -jar minecraft-server.jar --world-dir=worlds > /dev/null 2>&1
|
2018-05-25 19:49:13 +03:00
|
|
|
sleep 1
|
2018-07-11 17:10:41 +03:00
|
|
|
done' &
|
2018-05-25 19:49:13 +03:00
|
|
|
|
2018-06-10 08:22:56 +03:00
|
|
|
sleep infinity
|