mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-04-05 05:08:52 +00:00
Fix script import path for RCON_CMDS_* (#3695)
This commit is contained in:
17
scripts/shims/mc-health
Normal file
17
scripts/shims/mc-health
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
. "/image/scripts/start-utils"
|
||||
if [ -f /data/.mc-health.env ]; then
|
||||
. /data/.mc-health.env
|
||||
fi
|
||||
|
||||
if isTrue "${DISABLE_HEALTHCHECK}"; then
|
||||
echo "Healthcheck disabled"
|
||||
exit 0
|
||||
elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then
|
||||
echo "Java process suspended by Autopause function"
|
||||
exit 0
|
||||
else
|
||||
mc-monitor status "${MC_HEALTH_EXTRA_ARGS[@]}" --host "${SERVER_HOST:-localhost}" --port "${SERVER_PORT:-25565}"
|
||||
exit $?
|
||||
fi
|
||||
25
scripts/shims/mc-send-to-console
Normal file
25
scripts/shims/mc-send-to-console
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
. "/image/scripts/start-utils"
|
||||
: "${CONSOLE_IN_NAMED_PIPE:=/tmp/minecraft-console-in}"
|
||||
|
||||
if isFalse "${CREATE_CONSOLE_IN_PIPE:-false}"; then
|
||||
error "Console pipe needs to be enabled by setting CREATE_CONSOLE_IN_PIPE to true"
|
||||
fi
|
||||
|
||||
|
||||
if [ $# = 0 ]; then
|
||||
error "Pass console commands as arguments"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -p "${CONSOLE_IN_NAMED_PIPE}" ]; then
|
||||
error "Named pipe ${CONSOLE_IN_NAMED_PIPE} is missing"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$(id -u)" = 0 ]] && [[ $UID != 0 ]]; then
|
||||
error "Exec needs to be run with user ID $UID"
|
||||
exit 2
|
||||
else
|
||||
echo "$@" >"${CONSOLE_IN_NAMED_PIPE}"
|
||||
fi
|
||||
18
scripts/shims/mcstatus
Normal file
18
scripts/shims/mcstatus
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
warning "mcstatus is deprecated; calling mc-monitor instead"
|
||||
|
||||
##### 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"
|
||||
|
||||
IFS=':'
|
||||
read -a parts <<< "${addr}"
|
||||
args=(--host ${parts[0]})
|
||||
if [[ ${#parts[*]} -gt 1 ]]; then
|
||||
args+=(--port ${parts[1]})
|
||||
fi
|
||||
exec mc-monitor ${args[@]}
|
||||
Reference in New Issue
Block a user