improved connection detection

This commit is contained in:
Krumel
2021-05-06 18:00:11 +02:00
parent 9a00e24b4f
commit 64e2eb676f
2 changed files with 3 additions and 7 deletions

2
ServerStart.sh.template Executable file → Normal file
View File

@ -17,7 +17,7 @@ while true; do
echo "0" > /home/minecraft/scripts/lp_shutdown
mcconn=0
until [ $mcconn -ne 0 ]; do
mcconn=$(nc -l 25500 | cat -v | grep -cF '^@cM-^\^B')
mcconn=$(nc -l 25500 | cat -v | grep -czP '(\^X\^@M-r\^E\^Q)([\w\.]+)(\^@FML2\^@cM-\^\\\^B\n\^@\^H)([\w\.]+)')
if [ $mcconn -eq 0 ]; then
echo "Something connected, but it doesn't look like a minecraft connection"
else