mirror of
https://github.com/itzg/docker-minecraft-server
synced 2025-03-04 15:17:17 +00:00
parent
30ba3a4b78
commit
88ed017ca7
1 changed files with 9 additions and 12 deletions
9
mcstatus
9
mcstatus
|
@ -1,11 +1,12 @@
|
|||
#!/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
|
||||
|
||||
addr="$1"
|
||||
cmd="$2"
|
||||
|
||||
if [[ ${cmd} == "ping" ]]; then
|
||||
IFS=':'
|
||||
read -a parts <<< "${addr}"
|
||||
if [[ ${#parts[*]} -gt 1 ]]; then
|
||||
|
@ -13,7 +14,3 @@ if [[ ${cmd} == "ping" ]]; then
|
|||
else
|
||||
exec mc-monitor status --host ${parts[0]}
|
||||
fi
|
||||
else
|
||||
echo "ERROR can only shim the 'ping' command"
|
||||
exit 1
|
||||
fi
|
Loading…
Add table
Reference in a new issue