mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-12 21:32:28 +00:00
c8380daee5
For #426
19 lines
No EOL
364 B
Bash
Executable file
19 lines
No EOL
364 B
Bash
Executable file
#!/bin/bash
|
|
|
|
##### mcstatus shim for mc-monitor
|
|
|
|
addr="$1"
|
|
cmd="$2"
|
|
|
|
if [[ ${cmd} == "ping" ]]; then
|
|
IFS=':'
|
|
read -a parts <<< "${addr}"
|
|
if [[ ${#parts[*]} -gt 1 ]]; then
|
|
exec mc-monitor status --host ${parts[0]} --port ${parts[1]}
|
|
else
|
|
exec mc-monitor status --host ${parts[0]}
|
|
fi
|
|
else
|
|
echo "ERROR can only shim the 'ping' command"
|
|
exit 1
|
|
fi |