From c15e231d7e8bec6c909d74904e61e8deae65e7ba Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 20 Dec 2021 07:09:29 -0600 Subject: [PATCH] fix: write to console pipe as minecraft user (#1216) --- bin/mc-send-to-console | 2 +- scripts/start | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/mc-send-to-console b/bin/mc-send-to-console index a83f0e81..7615c241 100755 --- a/bin/mc-send-to-console +++ b/bin/mc-send-to-console @@ -12,4 +12,4 @@ if [ ! -p "${CONSOLE_IN_NAMED_PIPE}" ]; then exit 1 fi -echo "$@" > "${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}" \ No newline at end of file +gosu minecraft bash -c "echo $* > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'" \ No newline at end of file diff --git a/scripts/start b/scripts/start index 9e252956..95c2736e 100755 --- a/scripts/start +++ b/scripts/start @@ -40,7 +40,7 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ $(id -u) = 0 ]; then echo 'hosts: files dns' > /etc/nsswitch.conf fi - exec gosu ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration $@ + exec gosu ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration "$@" else - exec ${SCRIPTS:-/}start-configuration $@ + exec ${SCRIPTS:-/}start-configuration "$@" fi