buildpack/bin/start

38 lines
1.2 KiB
Plaintext
Raw Normal View History

2018-05-25 16:49:13 +00:00
#!/bin/bash
mkdir -p crash-reports/ dumps/
echo "$PRIVATE_KEY" > .ssh/id_rsa
2018-07-11 03:52:20 +00:00
chmod 400 $(find . ! -path "*/.*" -type f)
2018-10-01 15:14:59 +00:00
chmod -R 500 crash-reports/ dumps/ plugins/bStats/ plugins/PluginMetrics/ plugins/ProtocolLib/
2018-10-01 16:36:35 +00:00
ssh-keyscan notabug.org >> .ssh/known_hosts
2018-10-01 16:27:15 +00:00
git clone git@notabug.org:kaboom/schematics.git plugins/WorldEdit/schematics/
2018-05-25 16:49:13 +00:00
2018-09-30 15:09:01 +00:00
while true; do
2018-11-11 18:34:33 +00:00
cd $HOME/plugins/WorldEdit/schematics/
2018-10-01 16:27:15 +00:00
if [ "git status --porcelain" ]; then
git add --all
2018-11-11 18:39:28 +00:00
git -c user.name='kaboom' -c user.email='kaboom' commit -m "Add new schematics" > /dev/null 2>&1
git push > /dev/null 2>&1
2018-10-01 16:27:15 +00:00
fi
sleep 1
2018-09-30 15:09:01 +00:00
done &
2018-05-25 16:49:13 +00:00
2018-06-10 09:27:51 +00:00
while true; do
2018-10-01 16:27:15 +00:00
ssh -o StrictHostKeyChecking=no -S none -N -T -R 64518:localhost:25565 serv@kaboom.pw > /dev/null 2>&1
sleep 1
2018-06-10 09:27:51 +00:00
done &
2018-10-01 21:36:24 +00:00
.bin/tmux new -d -s server 'while true; do
2018-11-11 18:27:57 +00:00
.bin/java/bin/java -Xmx384M -Xss512k -Xaggressive -Xdisablejavadump -Xnoagent -Xquickstart -Xshareclasses -XX:MaxDirectMemorySize=384M -XX:-HeapDumpOnOutOfMemoryError -XX:+IdleTuningGcOnIdle -XX:+UseContainerSupport -Dcom.mojang.eula.agree=true -jar minecraft-server.jar --world-dir=worlds
2018-10-01 21:36:24 +00:00
sleep 1
done'
2018-09-30 21:09:50 +00:00
while true; do
2018-10-01 22:05:32 +00:00
sleep 120
if [ "$(echo -n -e '\xFE' | nc -w 5 localhost 25565 | wc -m)" -eq 0 ]; then
2018-10-01 21:36:24 +00:00
kill -9 $(pgrep java)
2018-10-01 16:27:15 +00:00
fi
2018-09-30 21:09:50 +00:00
done &
2018-05-25 16:49:13 +00:00
2018-06-10 05:22:56 +00:00
sleep infinity