diff --git a/bin/mc-send-to-console b/bin/mc-send-to-console index 91ae0b6504..c1a76b4a05 100755 --- a/bin/mc-send-to-console +++ b/bin/mc-send-to-console @@ -1,5 +1,5 @@ #!/bin/bash - +. "/start-utils" : "${CONSOLE_IN_NAMED_PIPE:=/tmp/minecraft-console-in}" if [ $# = 0 ]; then @@ -13,7 +13,11 @@ if [ ! -p "${CONSOLE_IN_NAMED_PIPE}" ]; then fi if [ "$(id -u)" = 0 ]; then - gosu minecraft bash -c "echo $* > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'" + if [[ $(getDistro) == alpine ]]; then + exec su-exec minecraft bash -c "echo $* > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'" + else + exec gosu minecraft bash -c "echo $* > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'" + fi else - echo "$@" > "${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}" -fi \ No newline at end of file + echo "$@" >"${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}" +fi