docker-minecraft-server/mcstatus

19 lines
364 B
Text
Raw Normal View History

2020-01-27 13:16:22 +00:00
#!/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
echo mc-monitor status --host ${parts[0]} --port ${parts[1]}
else
echo mc-monitor status --host ${parts[0]}
fi
else
echo "ERROR can only shim the 'ping' command"
exit 1
fi