mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
Fix alpine incompatibility (#1481)
This commit is contained in:
parent
b241f74615
commit
7e843ea100
@ -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
|
||||
echo "$@" >"${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user