docker-minecraft-server/mcstatus

17 lines
381 B
Text
Raw Normal View History

2020-01-27 13:16:22 +00:00
#!/bin/bash
##### mcstatus shim for mc-monitor
# handles translating calls to
# mcstatus (host:port) (command)
# where the actual command is ignore, but is typically ping or status
2020-01-27 13:16:22 +00:00
addr="$1"
IFS=':'
read -a parts <<< "${addr}"
if [[ ${#parts[*]} -gt 1 ]]; then
exec mc-monitor status --host ${parts[0]} --port ${parts[1]}
2020-01-27 13:16:22 +00:00
else
exec mc-monitor status --host ${parts[0]}
fi