diff --git a/bin/mc-send-to-console b/bin/mc-send-to-console index 7615c241..91ae0b65 100755 --- a/bin/mc-send-to-console +++ b/bin/mc-send-to-console @@ -12,4 +12,8 @@ if [ ! -p "${CONSOLE_IN_NAMED_PIPE}" ]; then exit 1 fi -gosu minecraft bash -c "echo $* > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'" \ No newline at end of file +if [ "$(id -u)" = 0 ]; then + gosu minecraft bash -c "echo $* > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'" +else + echo "$@" > "${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}" +fi \ No newline at end of file