diff --git a/docs/configuration/server-properties.md b/docs/configuration/server-properties.md index 1e647763..b9074159 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 00000000..9c1b3973 --- /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