buildpack/bin/start

31 lines
1.3 KiB
Text
Raw Normal View History

2018-05-25 19:49:13 +03:00
#!/bin/bash
mkdir -p crash-reports/ dumps/
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-09-30 18:14:53 +03:00
rsync -Waqz -e "ssh -o StrictHostKeyChecking=no -T -c aes256-ctr -o Compression=no -x" serv@kaboom.pw:sync/plugins/WorldEdit/schematics plugins/WorldEdit/
2018-05-25 19:49:13 +03:00
2018-09-30 18:09:01 +03:00
while true; do
2018-09-30 18:14:53 +03:00
rsync -Waq -e "ssh -o StrictHostKeyChecking=no -T -c aes256-ctr -o Compression=no -x" plugins/WorldEdit/schematics serv@kaboom.pw:sync/plugins/WorldEdit/ > /dev/null 2>&1
2018-09-30 18:09:01 +03:00
sleep 5
done &
2018-05-25 19:49:13 +03:00
2018-06-10 12:27:51 +03:00
while true; do
2018-07-11 19:59:26 +03:00
ssh -o StrictHostKeyChecking=no -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-10-01 00:09:50 +03:00
while true; do
2018-10-01 00:45:14 +03:00
if [ "$(echo -n -e '\xFE' | nc localhost 25565 | wc -m)" -eq 0 ]; then
2018-10-01 00:09:50 +03:00
.bin/tmux kill-session -t server
2018-10-01 14:34:08 +03:00
.bin/tmux new -d -s server 'while true; do
.bin/java/bin/java -Xmx400M -Xss512k -Xaggressive -Xdisablejavadump -Xnoagent -Xtune:virtualized -XX:MaxMetaspaceSize=100M -XX:MaxDirectMemorySize=50M -XX:-HeapDumpOnOutOfMemoryError -XX:+IdleTuningGcOnIdle -XX:+UseContainerSupport -Dcom.mojang.eula.agree=true -jar minecraft-server.jar --world-dir=worlds
sleep 1
done'
2018-10-01 00:09:50 +03:00
fi
2018-10-01 14:34:08 +03:00
sleep 120
2018-10-01 00:09:50 +03:00
done &
2018-05-25 19:49:13 +03:00
2018-06-10 08:22:56 +03:00
sleep infinity