Add timeout to netcat

This commit is contained in:
mathias 2018-10-01 20:17:26 +03:00
parent 15349adb53
commit 98d5aaf2a3

View file

@ -23,14 +23,14 @@ while true; do
done &
while true; do
if [ "$(echo -n -e '\xFE' | nc localhost 25565 | wc -m)" -eq 0 ]; then
if [ "$(echo -n -e '\xFE' | nc -w 1 localhost 25565 | wc -m)" -eq 0 ]; then
.bin/tmux kill-session -t server
.bin/tmux new -d -s server 'while true; do
.bin/java/bin/java -Xmx400M -Xss512k -Xaggressive -Xdisablejavadump -Xnoagent -Xquickstart -Xshareclasses -XX:MaxDirectMemorySize=200M -XX:-HeapDumpOnOutOfMemoryError -XX:+IdleTuningGcOnIdle -XX:+UseContainerSupport -Dcom.mojang.eula.agree=true -jar minecraft-server.jar --world-dir=worlds
sleep 1
done'
fi
sleep 120
sleep 60
done &
sleep infinity