From 675232697a23b0e47e32dfcd64a8c2080241c6bb Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 15 May 2024 16:07:46 -0500 Subject: [PATCH] docs: add compose example of multiline MOTD --- docs/configuration/server-properties.md | 18 +++++++++++++++++- examples/multiline-motd/docker-compose.yml | 12 ++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 examples/multiline-motd/docker-compose.yml diff --git a/docs/configuration/server-properties.md b/docs/configuration/server-properties.md index 1e647763f1d..b9074159961 100644 --- a/docs/configuration/server-properties.md +++ b/docs/configuration/server-properties.md @@ -64,9 +64,25 @@ The section symbol (ยง) and other unicode characters are automatically converted ![](../img/motd-example.png) -To produce a multi-line MOTD, embed a newline character as `\n` in the string, such as +To produce a multi-line MOTD, embed a newline character as `\n` in the string, such as the following example. +!!! example "Multi-line MOTD" + + With `docker run` + + ``` -e MOTD="Line one\nLine two" + ``` + + or within a compose file + + ```yaml + MOTD: | + line one + line two + # or + # MOTD: "line one\nline two" + ``` !!! tip diff --git a/examples/multiline-motd/docker-compose.yml b/examples/multiline-motd/docker-compose.yml new file mode 100644 index 00000000000..9c1b3973cc5 --- /dev/null +++ b/examples/multiline-motd/docker-compose.yml @@ -0,0 +1,12 @@ +services: + mc: + image: itzg/minecraft-server + environment: + EULA: true + MOTD: | + line one + line two +# or +# MOTD: "line one\nline two" + ports: + - "25565:25565" \ No newline at end of file