mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-13 13:52:27 +00:00
IPv6 support for autopause (#646)
This commit is contained in:
parent
3cb72797b6
commit
b7ac28e902
1 changed files with 2 additions and 2 deletions
|
@ -13,7 +13,7 @@ rcon_client_exists() {
|
|||
}
|
||||
|
||||
mc_server_listening() {
|
||||
[[ -n $(netstat -tln | grep "0.0.0.0:$SERVER_PORT" | grep LISTEN) ]]
|
||||
[[ -n $(netstat -tln | grep -e "0.0.0.0:$SERVER_PORT" -e ":::$SERVER_PORT" | grep LISTEN) ]]
|
||||
}
|
||||
|
||||
java_clients_connected() {
|
||||
|
@ -29,7 +29,7 @@ java_clients_connected() {
|
|||
# remember, that the host network mode does not work with autopause because of the knockd utility
|
||||
for (( i=0; i<${#connections[@]}; i++ ))
|
||||
do
|
||||
if [[ ! $(echo "${connections[$i]}" | awk '{print $5}') =~ ^\s*127\.0\.0\.1:.*$ ]] ; then
|
||||
if [[ ! $(echo "${connections[$i]}" | awk '{print $5}') =~ ^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*\:)*?:?0*1$ ]] ; then
|
||||
# not localhost
|
||||
return 0
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue