mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-04-04 04:38:52 +00:00
Add SERVER_HOST Environment in mc-monitor command (#2875)
This commit is contained in:
committed by
GitHub
parent
8fd98f0315
commit
c828985ebe
@@ -17,13 +17,13 @@ rcon_client_exists() {
|
||||
}
|
||||
|
||||
mc_server_listening() {
|
||||
mc-monitor status --host localhost --port "$SERVER_PORT" --timeout 10s >& /dev/null
|
||||
mc-monitor status --host "${SERVER_HOST:-localhost}" --port "$SERVER_PORT" --timeout 10s >& /dev/null
|
||||
}
|
||||
|
||||
java_clients_connections() {
|
||||
local connections
|
||||
if java_running ; then
|
||||
if ! connections=$(mc-monitor status --host localhost --port "$SERVER_PORT" --show-player-count); then
|
||||
if ! connections=$(mc-monitor status --host "${SERVER_HOST:-localhost}" --port "$SERVER_PORT" --show-player-count); then
|
||||
# consider it a non-zero player count if the ping fails
|
||||
# otherwise a laggy server with players connected could get paused
|
||||
connections=1
|
||||
|
||||
Reference in New Issue
Block a user