mirror of
https://github.com/kaboomserver/buildpack.git
synced 2024-09-28 19:23:01 +00:00
Improve alive checker
This commit is contained in:
parent
87dda2eae8
commit
874a0db1a1
|
@ -15,11 +15,12 @@ while true; do
|
||||||
# 3 minutes, kill the server
|
# 3 minutes, kill the server
|
||||||
|
|
||||||
if [ "$(env printf '\xFE' | nc -w 5 localhost 25565 | wc -m)" -eq 0 ] ||
|
if [ "$(env printf '\xFE' | nc -w 5 localhost 25565 | wc -m)" -eq 0 ] ||
|
||||||
[ "$(( $(date +%s) - $(date -r $logfile +%s) ))" -gt 180 ]; then
|
[ "$(( $(date +%s) - $(date -r $logfile +%s) ))" -gt 180 ] ||
|
||||||
|
[ "$(tail -5 $logfile | grep -cE 'Server thread|Paper Watchdog Thread|Async Chat Thread')" -eq 0 ]; then
|
||||||
if [ "$(tail -20 $logfile | grep -c 'ERROR]: Requested chunk')" -eq 1 ]; then
|
if [ "$(tail -20 $logfile | grep -c 'ERROR]: Requested chunk')" -eq 1 ]; then
|
||||||
rm -rf $HOME/worlds/
|
rm -rf $HOME/worlds/
|
||||||
fi
|
fi
|
||||||
pkill -9 java
|
pkill -9 java
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
Loading…
Reference in a new issue