From af97487c0a1a29bcbe9bb13d0868c9152ece8a98 Mon Sep 17 00:00:00 2001 From: mathiascode Date: Sat, 30 Nov 2019 18:18:45 +0200 Subject: [PATCH] Cleanups --- bin/start | 2 +- script/alivecheck | 13 ++++--------- script/remote | 8 ++++++-- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/bin/start b/bin/start index 66962e7..dfe8736 100755 --- a/bin/start +++ b/bin/start @@ -7,7 +7,7 @@ chmod 600 .ssh/remote ssh-keyscan github.com >> .ssh/known_hosts -chmod -R 500 plugins/bStats/ plugins/PluginMetrics/ plugins/ProtocolLib/ +chmod -R 500 plugins/bStats/ plugins/PluginMetrics/ git clone git@github.com:kaboomserver/schematics.git plugins/FastAsyncWorldEdit/schematics/ diff --git a/script/alivecheck b/script/alivecheck index ceaa540..bddaa1c 100755 --- a/script/alivecheck +++ b/script/alivecheck @@ -2,15 +2,10 @@ while true; do sleep 420 logfile=$HOME/logs/latest.log - if [ "$(env printf '\xFE' | nc -w 5 localhost 25565 | wc -m)" -eq 0 ]; then - if [ -f "$logfile" ]; then - if [ "$(tail -20 $logfile | grep -c 'ERROR]: Requested chunk')" -eq 1 ]; then - rm -rf $HOME/worlds/ - fi - fi - pkill -9 java - elif [ -f "$logfile" ]; then - if [ "$(( $(date +%s) - $(date -r $logfile +%s) ))" -gt 180 ]; then + + if [ -f "$logfile" ]; then + if [ "$(env printf '\xFE' | nc -w 5 localhost 25565 | wc -m)" -eq 0 ] || + [ "$(( $(date +%s) - $(date -r $logfile +%s) ))" -gt 180 ]; then if [ "$(tail -20 $logfile | grep -c 'ERROR]: Requested chunk')" -eq 1 ]; then rm -rf $HOME/worlds/ fi diff --git a/script/remote b/script/remote index 0cae763..05997e6 100755 --- a/script/remote +++ b/script/remote @@ -1,3 +1,7 @@ #!/bin/sh -#export AUTOSSH_POLL=30 -ssh -i ~/.ssh/remote -o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes -o StreamLocalBindUnlink=yes -c aes128-ctr -C -S none -N -T -R 25565:localhost:25565 remote@play.kaboom.pw +ssh -i ~/.ssh/remote \ + -o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes -o StreamLocalBindUnlink=yes \ + -c aes128-ctr \ + -C -S none -N -T -R \ + 25565:localhost:25565 \ + remote@play.kaboom.pw