From 7fd0f9e399e492f06f0ec6342ef2d4ec1e493488 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 10 Mar 2022 17:10:04 -0600 Subject: [PATCH] Revert "Add mc-send-to-console support (#228)" This reverts commit f5c95df5a07cbc320334d6b98e1925927b04fcb7. --- Dockerfile | 3 +-- README.md | 12 +----------- scripts/bedrock-entry.sh => bedrock-entry.sh | 6 +----- bin/mc-send-to-console | 15 --------------- 4 files changed, 3 insertions(+), 33 deletions(-) rename scripts/bedrock-entry.sh => bedrock-entry.sh (96%) delete mode 100755 bin/mc-send-to-console diff --git a/Dockerfile b/Dockerfile index ce6b225..eb12cd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,8 +33,7 @@ RUN easy-add --var version=1.5.0 --var app=restify --file {{.app}} --from https: RUN easy-add --var version=0.5.0 --var app=mc-monitor --file {{.app}} --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_linux_${ARCH}.tar.gz -COPY scripts/* /opt/ -COPY bin/* /usr/local/bin/ +COPY *.sh /opt/ COPY property-definitions.json /etc/bds-property-definitions.json diff --git a/README.md b/README.md index 1cb0530..e22e918 100644 --- a/README.md +++ b/README.md @@ -188,17 +188,7 @@ For more information [FoxyNoTail](https://www.youtube.com/watch?v=nWBM4UFm0rQ&t= For more information about managing Bedrock Dedicated Servers in general, [check out this Reddit post](https://old.reddit.com/user/ProfessorValko/comments/9f438p/bedrock_dedicated_server_tutorial/). -## Sending commands to the server - -To send individual commands to the server, exec `mc-send-to-console` inside the container passing the server command as its arguments. For example, the following would disable the `falldamage` gamerule: - -```shell -docker exec $container mc-send-to-console gamerule falldamage false -``` - -> NOTE: to see the output/results of the command, use `docker logs -f $container` - -## Interactive server console +## Executing server commands Assuming you started container with stdin and tty enabled (such as using `-it`), you can attach to the container's console by its name or ID using: diff --git a/scripts/bedrock-entry.sh b/bedrock-entry.sh similarity index 96% rename from scripts/bedrock-entry.sh rename to bedrock-entry.sh index 5845180..e77b6ef 100755 --- a/scripts/bedrock-entry.sh +++ b/bedrock-entry.sh @@ -160,8 +160,4 @@ set-property --file server.properties --bulk /etc/bds-property-definitions.json export LD_LIBRARY_PATH=. echo "Starting Bedrock server..." - -mkfifo /var/run/bds-stdin -# See https://serverfault.com/a/1088115/196770 -sleep infinity > /var/run/bds-stdin & -exec ./bedrock_server-"${VERSION}" < /var/run/bds-stdin +exec ./bedrock_server-${VERSION} diff --git a/bin/mc-send-to-console b/bin/mc-send-to-console deleted file mode 100755 index 041a65e..0000000 --- a/bin/mc-send-to-console +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -: "${CONSOLE_IN_NAMED_PIPE:=/var/run/bds-stdin}" - -if [ $# = 0 ]; then - echo "ERROR: pass console commands as arguments" - exit 1 -fi - -if [ ! -p "${CONSOLE_IN_NAMED_PIPE}" ]; then - echo "ERROR: named pipe ${CONSOLE_IN_NAMED_PIPE} is missing" - exit 1 -fi - -/usr/local/bin/entrypoint-demoter --match /data bash -c "echo $* > '${CONSOLE_IN_NAMED_PIPE}'" \ No newline at end of file