mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-06-03 09:19:43 +00:00
RCON commands feature (#1391)
Co-authored-by: christopher blodgett <christopher.blodgett@gmail.com>
This commit is contained in:
@@ -20,12 +20,16 @@ mc_server_listening() {
|
||||
mc-monitor status --host localhost --port "$SERVER_PORT" --timeout 10s >& /dev/null
|
||||
}
|
||||
|
||||
java_clients_connected() {
|
||||
java_clients_connections() {
|
||||
local connections
|
||||
if java_running ; then
|
||||
connections=$(mc-monitor status --host localhost --port "$SERVER_PORT" --show-player-count)
|
||||
else
|
||||
connections=0
|
||||
fi
|
||||
(( connections > 0 ))
|
||||
echo $connections
|
||||
}
|
||||
|
||||
java_clients_connected() {
|
||||
(( $(java_clients_connections) > 0 ))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user