From a905435bfc2bfa6bb1a7a6635eeae093b010d77a Mon Sep 17 00:00:00 2001 From: Daniel Ceregatti Date: Wed, 29 May 2024 01:42:38 -0700 Subject: [PATCH] Add support for detecting the version of the server. It's very ghetto. There must be a better way. --- server/Dockerfile | 1 + server/bin/dz | 10 ++++++++++ web/Dockerfile | 1 + web/bin/dz | 13 ++++++++++++- 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index f9f2cd7..d90635b 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -11,6 +11,7 @@ RUN sed -i /etc/apt/sources.list.d/debian.sources -e 's/Components: main/Compone # Install _only_ the necessary packages RUN apt-get update && apt-get -y upgrade && apt-get -y install --no-install-recommends \ + binutils \ gwenhywfar-tools \ jq \ libxml2-utils \ diff --git a/server/bin/dz b/server/bin/dz index ba5d836..e949e40 100755 --- a/server/bin/dz +++ b/server/bin/dz @@ -571,6 +571,15 @@ status(){ # Current parameters RUNNING="${RUNNING}\nRunning Parameters: $(cat /tmp/parameters)\nRunning mod parameter: $(cat /tmp/mod_command_line)" fi + # Release or Experimental + if [[ ${release_client_appid} = "221100" ]] + then + RELEASE="Stable" + else + RELEASE="Experimental" + fi + VERSION="$(strings /serverfiles/DayZServer | grep -P "DayZ \d\.\d+\.\d+" | cut -c6-) - ${RELEASE}" + # Map MAP=${MAP} # Number of mods plus the list denoting on or off echo -ne " @@ -592,6 +601,7 @@ Working mod parameter: ${mod_command_line}" if [[ "${INSTALLED}" = "${YES}" ]] then echo "Map: ${MAP}" + echo "Version: ${VERSION}" fi echo } diff --git a/web/Dockerfile b/web/Dockerfile index f1b9388..3eb05b3 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -14,6 +14,7 @@ RUN sed -i /etc/apt/sources.list.d/debian.sources -e 's/Components: main/Compone # Install _only_ the necessary packages RUN apt-get update && apt-get -y upgrade && apt-get -y install --no-install-recommends \ + binutils \ curl \ gwenhywfar-tools \ jq \ diff --git a/web/bin/dz b/web/bin/dz index 587dce1..fe6e796 100755 --- a/web/bin/dz +++ b/web/bin/dz @@ -28,7 +28,7 @@ Options and arguments: m|modupdate - Update the mod files p|map id - Install a mod's mpmissions files by id. (Presumes template exists) r|remove id - Remove all files and directories of a Workshop item by id - s|status - Shows Steam login status, if base files are installed, installed mods + l|s|status - Shows Steam login status, if base files are installed, installed mods u|update - Update the server files x|xml id - Get and normalize XML files from a mod's template by id (Presumes template exists) ${default}" @@ -260,6 +260,13 @@ status(){ if [ -f "${SERVER_INSTALL_FILE}" ] then INSTALLED="${YES}" + if [[ ${release_client_appid} = "221100" ]] + then + RELEASE="Stable" + else + RELEASE="Experimental" + fi + VERSION="$(strings /serverfiles/DayZServer | grep -P "DayZ \d\.\d+\.\d+" | cut -c6-) - ${RELEASE}" fi # Logged into Steam if [ -f "${STEAM_LOGIN}" ] @@ -281,6 +288,10 @@ Server files installed: ${INSTALLED}" echo exit 0 fi + # Version of DayZ Server files + echo -ne " +Version: ${VERSION}" + # Mods echo -ne " Mods: "