allow env in motd

This commit is contained in:
Bryson Steck 2025-08-10 13:10:31 -06:00
parent f642050104
commit 7fe09ebba9
Signed by: bryson
SSH key fingerprint: SHA256:XpKABw/nP4z8UVaH+weLaBnEOD86+cVwif+QjuYLGT4
2 changed files with 3 additions and 1 deletions

View file

@ -16,6 +16,7 @@ RUN go install github.com/a8m/envsubst/cmd/envsubst@latest
FROM base AS package FROM base AS package
ARG MINECRAFT_VERSION="1.20.6" ARG MINECRAFT_VERSION="1.20.6"
ENV MINECRAFT_VERSION $MINECRAFT_VERSION
RUN apk add --no-cache --upgrade rcon eudev-libs RUN apk add --no-cache --upgrade rcon eudev-libs
WORKDIR / WORKDIR /

View file

@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
export MINECRAFT_VERSION=SED_VERSION # add environment variables to motd
export MC_MOTD=$(echo $MC_MOTD | envsubst)
cleanup() { cleanup() {
rcon -m -p 25575 --host localhost --password "${MC_RCON_PASSWORD}" say Warning! Server is shutting down in 5 seconds... rcon -m -p 25575 --host localhost --password "${MC_RCON_PASSWORD}" say Warning! Server is shutting down in 5 seconds...