Skip to content

Commit

Permalink
feat: add validate on start.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 committed Sep 1, 2024
1 parent 251cd80 commit c11efd5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Dockerfile.ubuntu-2004
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ENV LGSM_DATADIR=/data/data
ENV LGSM_CONFIG=/data/config-lgsm
ENV LGSM_DEV=false
ENV GAMESERVER=jc2server
ENV VALIDATE_ON_START=false
ENV UPDATE_CHECK=60
ENV USER=linuxgsm
ENV UID=1000
Expand Down Expand Up @@ -90,7 +91,7 @@ RUN echo "**** Install Node.js ****" \

# Install GameDig https://docs.linuxgsm.com/requirements/gamedig
RUN echo "**** Install GameDig ****" \
&& npm install -g gamedig@5.0.0
&& npm install -g gamedig@5
WORKDIR /app/lgsm \
wget -N --no-check-certificate "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${LGSM_GITHUBBRANCH}/package.json" \
&& npm install
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.ubuntu-2204
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ENV LGSM_DATADIR=/data/data
ENV LGSM_CONFIG=/data/config-lgsm
ENV LGSM_DEV=false
ENV GAMESERVER=jc2server
ENV VALIDATE_ON_START=false
ENV UPDATE_CHECK=60
ENV USER=linuxgsm
ENV UID=1000
Expand Down Expand Up @@ -90,7 +91,7 @@ RUN echo "**** Install Node.js ****" \

# Install GameDig https://docs.linuxgsm.com/requirements/gamedig
RUN echo "**** Install GameDig ****" \
&& npm install -g gamedig@5.0.0
&& npm install -g gamedig@5

WORKDIR /app

Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.ubuntu-2404
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ENV LGSM_DATADIR=/data/data
ENV LGSM_CONFIG=/data/config-lgsm
ENV LGSM_DEV=false
ENV GAMESERVER=jc2server
ENV VALIDATE_ON_START=false
ENV UPDATE_CHECK=60
ENV USER=linuxgsm
ENV UID=1001
Expand Down Expand Up @@ -91,7 +92,7 @@ RUN echo "**** Install Node.js ****" \

# Install GameDig https://docs.linuxgsm.com/requirements/gamedig
RUN echo "**** Install GameDig ****" \
&& npm install -g gamedig@5.0.0
&& npm install -g gamedig@5

WORKDIR /app

Expand Down
14 changes: 10 additions & 4 deletions entrypoint-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,18 @@ echo -e "================================="
echo -e "*/${UPDATE_CHECK} * * * * /app/${GAMESERVER} update > /dev/null 2>&1" | crontab -
echo -e "update will check every ${UPDATE_CHECK} minutes"

# Update game server
# Update or validate game server
if [ -z "${install}" ]; then
echo -e ""
echo -e "Checking for Update ${GAMESERVER}"
echo -e "================================="
./"${GAMESERVER}" update
if [ "${VALIDATE_ON_START,,}" = "true" ]; then
echo -e "Validating ${GAMESERVER}"
echo -e "================================="
./"${GAMESERVER}" validate
else
echo -e "Checking for Update ${GAMESERVER}"
echo -e "================================="
./"${GAMESERVER}" update
fi
fi

echo -e ""
Expand Down

0 comments on commit c11efd5

Please sign in to comment.