buildpack/bin/start

41 lines
1.3 KiB
Plaintext
Raw Normal View History

2018-05-25 16:49:13 +00:00
#!/bin/bash
2018-11-24 21:58:52 +00:00
mkdir -p dumps/
2019-02-02 23:40:25 +00:00
echo "$REMOTE_KEY" > .ssh/remote
echo "$SYNC_KEY" > .ssh/id_rsa
chmod 600 .ssh/remote
2018-11-24 20:44:20 +00:00
chmod -R 500 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-12-14 13:31:48 +00:00
./tmux new -d -s server 'while true; do
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 16:27:15 +00:00
sleep 1
2018-11-11 19:04:26 +00:00
done'
2018-05-25 16:49:13 +00:00
2018-12-14 13:31:48 +00:00
./tmux new -d -s remote 'while true; do
2019-02-23 11:22:30 +00:00
ssh -i ~/.ssh/remote -o Compression=no -o ExitOnForwardFailure=yes -o StreamLocalBindUnlink=yes -o StrictHostKeyChecking=no -c aes128-gcm@openssh.com -S none -N -T -R 64518:localhost:25565 serv@play.kaboom.pw
2018-10-01 16:27:15 +00:00
sleep 1
2018-11-11 18:57:52 +00:00
done'
2018-06-10 09:27:51 +00:00
2018-12-14 13:31:48 +00:00
./tmux new -d -s schematics 'while true; do
2018-11-11 19:04:26 +00:00
cd $HOME/plugins/WorldEdit/schematics/
2019-02-23 12:55:49 +00:00
if [ "$(git diff --name-only --diff-filter=A HEAD)" ]; then
2018-11-11 19:04:26 +00:00
git add --all
2018-11-11 19:08:51 +00:00
git -c user.name='kaboom' -c user.email='kaboom' commit -m "Add new schematics"
git push
2018-11-11 19:04:26 +00:00
fi
sleep 1
done'
2018-05-25 16:49:13 +00:00
2018-11-13 04:08:36 +00:00
sleep 60
2018-11-11 19:45:48 +00:00
while true; do
sleep 120
2018-11-11 19:46:20 +00:00
if [ "$(echo -n -e '\xFE' | nc -w 5 localhost 25565 | wc -m)" -eq 0 ]; then
2018-11-11 19:45:48 +00:00
kill -9 $(pgrep java)
fi
done &
2018-06-10 05:22:56 +00:00
sleep infinity