Skip to content

Commit 1cc732d

Browse files
committed
Update ghcr.io/ptero-eggs/games:source to match steamcmd yolks entrypoint
Resolves a few issues with the yolk including broken SRCDS_BETAID
1 parent 1ab44da commit 1cc732d

1 file changed

Lines changed: 11 additions & 25 deletions

File tree

games/source/entrypoint.sh

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,19 @@ export INTERNAL_IP
3636
# Switch to the container's working directory
3737
cd /home/container || exit 1
3838

39-
40-
## just in case someone removed the defaults.
41-
if [ "${STEAM_USER}" == "" ]; then
42-
echo -e "steam user is not set.\n"
43-
echo -e "Using anonymous user.\n"
44-
STEAM_USER=anonymous
45-
STEAM_PASS=""
46-
STEAM_AUTH=""
47-
else
48-
echo -e "user set to ${STEAM_USER}"
39+
# Set default values for steam if not provided
40+
STEAM_USER=${STEAM_USER:-anonymous}
41+
if [ "${STEAM_USER}" == "anonymous" ]; then
42+
STEAM_PASS=""
43+
STEAM_AUTH=""
4944
fi
5045

51-
## if auto_update is not set or to 1 update
52-
if [ -z ${AUTO_UPDATE} ] || [ "${AUTO_UPDATE}" == "1" ]; then
53-
# Update Source Server
54-
if [ ! -z ${SRCDS_APPID} ]; then
55-
if [ "${STEAM_USER}" == "anonymous" ]; then
56-
./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +app_update ${SRCDS_APPID} +app_update 1007 $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) $( [[ -z ${HLDS_GAME} ]] || printf %s "+app_set_config 90 mod ${HLDS_GAME}" ) $( [[ -z ${VALIDATE} ]] || printf %s "validate" ) +quit
57-
else
58-
numactl --physcpubind=+0 ./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +app_update ${SRCDS_APPID} +app_update 1007 $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) $( [[ -z ${HLDS_GAME} ]] || printf %s "+app_set_config 90 mod ${HLDS_GAME}" ) $( [[ -z ${VALIDATE} ]] || printf %s "validate" ) +quit
59-
fi
60-
else
61-
echo -e "No appid set. Starting Server"
62-
fi
63-
64-
else
65-
echo -e "Not updating game server as auto update was set to 0. Starting Server"
46+
## If AUTO_UPDATE is not set or is set to 1, run steamcmd to update the server
47+
if [ -z "${AUTO_UPDATE}" ] || [ "${AUTO_UPDATE}" == "1" ]; then
48+
if [ -n "${SRCDS_APPID}" ]; then
49+
# shellcheck disable=SC2046,SC2086
50+
./steamcmd/steamcmd.sh +force_install_dir /home/container +login "${STEAM_USER}" "${STEAM_PASS}" "${STEAM_AUTH}" $([[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows') $([[ -z ${HLDS_GAME} ]] || printf %s "+app_set_config 90 mod ${HLDS_GAME}") "+app_update ${SRCDS_APPID} $([[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}") $([[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}") ${INSTALL_FLAGS} $([[ "${VALIDATE}" == "1" ]] && printf %s 'validate')" $([[ "${UPDATE_STEAMWORKS}" == "1" ]] && printf %s '+app_update 1007') +quit
51+
fi
6652
fi
6753

6854
# Replace Startup Variables

0 commit comments

Comments
 (0)