From 8193cfe261f792e9c615271e097227a3dfea896f Mon Sep 17 00:00:00 2001 From: David Caballero Date: Mon, 6 Mar 2023 08:39:01 +0000 Subject: [PATCH] Support for server password --- README.MD | 2 ++ scripts/entry.sh | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/README.MD b/README.MD index 7bb43e1..aee7593 100644 --- a/README.MD +++ b/README.MD @@ -12,6 +12,8 @@ This dockerfile converts some env variables to arguments in the server command, `ADMINPASSWORD:` Sets or changes the admin password. Is mandatory at first startup or will fail. I recommend to remove it once the server is started because the server logs every argument in clear text (if doesn't cares, you can leave it). +`PASSWORD:` Sets or changes server password. Is optional. + `CACHEDIR:` Set the folder where the data will be stored. By default the server stores the data in the Zomboid folder in home directory (/home/steam/Zomboid). Is recommended to store this data into a persistent volume to keep the server state. `DEBUG:` Enable the debug mode in server diff --git a/scripts/entry.sh b/scripts/entry.sh index f233402..cb557fb 100644 --- a/scripts/entry.sh +++ b/scripts/entry.sh @@ -68,6 +68,11 @@ if [ -n "${ADMINPASSWORD}" ]; then ARGS="${ARGS} -adminpassword ${ADMINPASSWORD}" fi +# Server password +if [ -n "${PASSWORD}" ]; then + ARGS="${ARGS} -password ${PASSWORD}" +fi + # You can choose a different servername by using this option when starting the server. if [ -n "${SERVERNAME}" ]; then ARGS="${ARGS} -servername ${SERVERNAME}"