mirror of
https://github.com/kaboomserver/buildpack.git
synced 2024-10-01 04:33:03 +00:00
43 lines
1.4 KiB
Bash
Executable file
43 lines
1.4 KiB
Bash
Executable file
#!/bin/sh
|
|
PATH="$HOME/java/bin/:$HOME/tmux/bin/:$PATH"
|
|
|
|
echo "$REMOTE_KEY" > .ssh/remote
|
|
echo "$SYNC_KEY" > .ssh/id_rsa
|
|
chmod 600 .ssh/remote
|
|
|
|
ssh-keyscan github.com >> .ssh/known_hosts
|
|
|
|
chmod -R 500 plugins/bStats/ plugins/PluginMetrics/ plugins/ProtocolLib/
|
|
|
|
git clone git@github.com:kaboomserver/schematics.git plugins/FastAsyncWorldEdit/schematics/
|
|
|
|
tmux new -d -s server 'while true; do
|
|
java -Xmx384M -Xss512k -Xaggressive -Xcompressedrefs -Xdump:none -Xgcpolicy:balanced -Xcompactexplicitgc -Xcompactgc -Xquickstart -Xshareclasses -XX:-HeapDumpOnOutOfMemoryError -XX:MaxDirectMemorySize=64M -XX:+UseContainerSupport -Dcom.mojang.eula.agree=true -Dpaper.playerconnection.keepalive=360 -jar minecraft-server.jar --world-dir=worlds
|
|
sleep 1
|
|
done'
|
|
|
|
tmux new -d -s remote 'while true; do
|
|
ssh -i ~/.ssh/remote -o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes -o StreamLocalBindUnlink=yes -c aes128-ctr -C -S none -N -T -R 53950:localhost:25565 -p 53940 remote@play.kaboom.pw
|
|
sleep 1
|
|
done'
|
|
|
|
tmux new -d -s schematics 'while true; do
|
|
cd $HOME/plugins/FastAsyncWorldEdit/schematics/
|
|
if [ "$(git add $(git ls-files -o) -v)" ]; then
|
|
git -c user.name='kaboom' -c user.email='kaboom.pw' commit -m "Add new schematics"
|
|
git push
|
|
fi
|
|
sleep 1
|
|
done'
|
|
|
|
sleep 90
|
|
|
|
while true; do
|
|
sleep 120
|
|
if [ "$(env printf '\xFE' | nc -w 5 localhost 25565 | wc -m)" -eq 0 ]; then
|
|
kill -9 $(pgrep java)
|
|
fi
|
|
done &
|
|
|
|
sleep infinity
|