2020-01-27 13:16:22 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-04-11 15:51:30 +00:00
|
|
|
echo "WARNING: mcstatus is deprecated; calling mc-monitor instead"
|
|
|
|
|
2020-01-27 13:16:22 +00:00
|
|
|
##### mcstatus shim for mc-monitor
|
2020-01-29 14:57:31 +00:00
|
|
|
# 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"
|
|
|
|
|
2020-01-29 14:57:31 +00:00
|
|
|
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
|
2020-01-29 14:57:31 +00:00
|
|
|
exec mc-monitor status --host ${parts[0]}
|
|
|
|
fi
|