mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-09-21 05:08:30 +00:00
@@ -1,19 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
##### mcstatus shim for mc-monitor
|
##### 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"
|
addr="$1"
|
||||||
cmd="$2"
|
|
||||||
|
|
||||||
if [[ ${cmd} == "ping" ]]; then
|
IFS=':'
|
||||||
IFS=':'
|
read -a parts <<< "${addr}"
|
||||||
read -a parts <<< "${addr}"
|
if [[ ${#parts[*]} -gt 1 ]]; then
|
||||||
if [[ ${#parts[*]} -gt 1 ]]; then
|
exec mc-monitor status --host ${parts[0]} --port ${parts[1]}
|
||||||
exec mc-monitor status --host ${parts[0]} --port ${parts[1]}
|
|
||||||
else
|
|
||||||
exec mc-monitor status --host ${parts[0]}
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "ERROR can only shim the 'ping' command"
|
exec mc-monitor status --host ${parts[0]}
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
|
|||||||
Reference in New Issue
Block a user