Experimental support for downloading configuration tgz

This commit is contained in:
John Edwards 2023-11-11 09:07:37 +00:00
parent f0f288ffc2
commit de9dc02dbd
2 changed files with 17 additions and 11 deletions

View file

@ -11,7 +11,6 @@ LABEL maintainer="joedwards32@gmail.com"
ENV STEAMAPPID 730
ENV STEAMAPP cs2
ENV STEAMAPPDIR "${HOMEDIR}/${STEAMAPP}-dedicated"
ENV CFG_URL https://raw.githubusercontent.com/joedwards32/CS2/settings.tgz
COPY etc/entry.sh "${HOMEDIR}/entry.sh"
COPY etc/server.cfg "/etc/server.cfg"
@ -60,6 +59,7 @@ ENV CS2_SERVERNAME="cs2 private server" \
TV_MAXRATE=0 \
TV_DELAY=0 \
SRCDS_TOKEN="" \
CS2_CFG_URL="" \
CS2_ADDITIONAL_ARGS=""
# Set permissions on STEAMAPPDIR

View file

@ -16,6 +16,22 @@ ln -sfT ${STEAMCMDDIR}/linux64/steamclient.so ~/.steam/sdk64/steamclient.so
# Install server.cfg
cp /etc/server.cfg "${STEAMAPPDIR}"/game/csgo/cfg/server.cfg
# Install hooks
if [[ ! -f "${STEAMAPPDIR}/pre.sh" ]] ; then
cp /etc/pre.sh "${STEAMAPPDIR}/pre.sh"
fi
if [[ ! -f "${STEAMAPPDIR}/post.sh" ]] ; then
cp /etc/post.sh "${STEAMAPPDIR}/post.sh"
fi
# Download and extract custom config bundle
if [[ ! -z $CS2_CFG_URL ]]; then
wget -qO- "${CS2_CFG_URL}" | tar xvzf - -C "${STEAMAPPDIR}"
fi
# Rewrite Config Files
sed -i -e "s/{{SERVER_HOSTNAME}}/${CS2_SERVERNAME}/g" \
-e "s/{{SERVER_PW}}/${CS2_PW}/g" \
-e "s/{{SERVER_RCON_PW}}/${CS2_RCONPW}/g" \
@ -28,16 +44,6 @@ sed -i -e "s/{{SERVER_HOSTNAME}}/${CS2_SERVERNAME}/g" \
-e "s/{{TV_DELAY}}/${TV_DELAY}/g" \
"${STEAMAPPDIR}"/game/csgo/cfg/server.cfg
# Install hooks
if [[ ! -f "${STEAMAPPDIR}/pre.sh" ]] ; then
cp /etc/pre.sh "${STEAMAPPDIR}/pre.sh"
fi
if [[ ! -f "${STEAMAPPDIR}/post.sh" ]] ; then
cp /etc/post.sh "${STEAMAPPDIR}/post.sh"
fi
# Rewrite Config Files
if [[ ! -z $CS2_BOT_DIFFICULTY ]] ; then
sed -i "s/bot_difficulty.*/bot_difficulty ${CS2_BOT_DIFFICULTY}/" "${STEAMAPPDIR}"/game/csgo/cfg/*
fi