From 7e843ea10016956ba2afc61aa60804ae0a14010a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Stefa=C5=84czyk?= Date: Tue, 19 Apr 2022 23:42:40 +0100 Subject: [PATCH] Fix alpine incompatibility (#1481) --- bin/mc-send-to-console | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/mc-send-to-console b/bin/mc-send-to-console index 91ae0b65..c1a76b4a 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