mirror of
https://github.com/kaboomserver/framework.git
synced 2024-06-30 17:49:02 +00:00
18 lines
326 B
Bash
Executable file
18 lines
326 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# The following script is a failsafe for killing the Minecraft server if it happens
|
|
# to be stuck
|
|
|
|
set -x
|
|
|
|
while true; do
|
|
sleep 420
|
|
|
|
# If the server doesn't respond to ping, kill it
|
|
|
|
if [ "$(env printf '\xFE' | nc -w 15 0.0.0.0 25565 | wc -m)" -eq 0 ]; then
|
|
pkill -9 java
|
|
echo $(date) >> ~/kill.log
|
|
fi
|
|
done
|