Fix mc-send-to-console running with uid=0(root) (#3106)

This commit is contained in:
ギリ猫
2024-10-15 20:08:17 +08:00
committed by GitHub
parent 7dbeac99d3
commit 4085d28773

View File

@@ -17,7 +17,7 @@ if [ ! -p "${CONSOLE_IN_NAMED_PIPE}" ]; then
exit 1
fi
if [ "$(id -u)" = 0 ]; then
if [ "$(id -u)" = 0 -a $UID != 0 ]; then
if [[ $(getDistro) == alpine ]]; then
exec su-exec minecraft bash -c "echo '$*' > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'"
else