Bundle send-command script (#296)
This commit is contained in:
1 parent
8ada363d5a
commit
ab51be217c
3 files changed
+27
-2
No files matched your search
@@ -48,6 +48,7 @@ RUN easy-add --var version=0.5.0 --var app=mc-monitor --file {{.app}} --from htt
|
||||
COPY *.sh /opt/
|
||||
|
||||
COPY property-definitions.json /etc/bds-property-definitions.json
|
||||
COPY bin/* /usr/local/bin/
|
||||
|
||||
# Available versions listed at
|
||||
# https://minecraft.gamepedia.com/Bedrock_Edition_1.11.0
|
||||
|
||||
@@ -190,7 +190,15 @@ For more information about managing Bedrock Dedicated Servers in general, [check
|
||||
|
||||
## 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:
|
||||
This image comes bundled with a script called `send-command` that will send a Bedrock command and argument to the Bedrock server console. The output of the command only be visible in the container logs.
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
docker exec CONTAINER_NAME_OR_ID send-command gamerule dofiretick false
|
||||
```
|
||||
|
||||
Alternatively, with stdin and tty enabled (such as using `-it`), attach to the container's console by its name or ID using:
|
||||
|
||||
```shell script
|
||||
docker attach CONTAINER_NAME_OR_ID
|
||||
@@ -199,7 +207,7 @@ docker attach CONTAINER_NAME_OR_ID
|
||||
While attached, you can execute any server-side commands, such as op'ing your player to be admin:
|
||||
|
||||
```
|
||||
op YOUR_XBOX_USERNAME
|
||||
gamerule dofiretick false
|
||||
```
|
||||
|
||||
When finished, detach from the server console using Ctrl-p, Ctrl-q
|
||||
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $* ]]; then
|
||||
if proc=$(find /proc -mindepth 2 -maxdepth 2 -name exe -lname '/data/bedrock_server-*' -printf '%h' -quit); then
|
||||
if [[ $proc ]]; then
|
||||
echo "$@" > "$proc/fd/0"
|
||||
else
|
||||
echo "ERROR: unable to find bedrock server process"
|
||||
exit 2
|
||||
fi
|
||||
else
|
||||
echo "ERROR: failed to search for bedrock server process"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user