Skip to content

Commit

Permalink
add support for depotdownloader to image
Browse files Browse the repository at this point in the history
  • Loading branch information
gOOvER committed Jan 12, 2025
1 parent cb6cad3 commit 452793a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 20 deletions.
34 changes: 18 additions & 16 deletions steam/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,36 @@ sleep 2
# Switch to the container's working directory
cd /home/container || exit 1

echo -e "${BLUE}----------------------------------------------------------------------------------${NC}"
echo -e "${GREEN}SteamCMD updating Server... Please wait...${NC}"
echo -e "${BLUE}----------------------------------------------------------------------------------${NC}"

## just in case someone removed the defaults.
if [ "${STEAM_USER}" == "" ]; then
echo -e "${BLUE}----------------------------------------------------------------------------------${NC}"
echo -e "${YELLOW}Steam user is not set. ${NC}"
echo -e "${YELLOW}Using anonymous user.${NC}"
echo -e "${BLUE}----------------------------------------------------------------------------------${NC}"
echo -e "${BLUE}---------------------------------------------------------------------${NC}"
echo -e "${YELLOW}Steam user is not set.\n ${NC}"
echo -e "${YELLOW}Using anonymous user.\n ${NC}"
echo -e "${BLUE}---------------------------------------------------------------------${NC}"
STEAM_USER=anonymous
STEAM_PASS=""
STEAM_AUTH=""
else
echo -e "${BLUE}----------------------------------------------------------------------------------${NC}"
echo -e "${BLUE}---------------------------------------------------------------------${NC}"
echo -e "${YELLOW}user set to ${STEAM_USER} ${NC}"
echo -e "${BLUE}----------------------------------------------------------------------------------${NC}"
echo -e "${BLUE}---------------------------------------------------------------------${NC}"
fi

## if auto_update is not set or to 1 update
if [ -z ${AUTO_UPDATE} ] || [ "${AUTO_UPDATE}" == "1" ]; then
# Update Source Server
./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) $( [[ "${STEAM_SDK}" == "1" ]] && printf %s '+app_update 1007' ) +app_update ${STEAM_APPID} $( [[ -z ${STEAM_BETAID} ]] || printf %s "-beta ${STEAM_BETAID}" ) $( [[ -z ${STEAM_BETAPASS} ]] || printf %s "-betapassword ${STEAM_BETAPASS}" ) ${INSTALL_FLAGS} $( [[ "${VALIDATE}" == "1" ]] && printf %s 'validate' ) +quit

if [ -f /home/container/DepotDownloader ]; then
./DepotDownloader -dir /home/container -username ${STEAM_USER} -password ${STEAM_PASS} -remember-password $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '-os windows' ) -app ${STEAM_APPID} $( [[ -z ${STEAM_BETAID} ]] || printf %s "-beta ${STEAM_BETAID}" ) $( [[ -z ${STEAM_BETAPASS} ]] || printf %s "-betapassword ${STEAM_BETAPASS}" )
mkdir -p /home/container/.steam/sdk64
./DepotDownloader -dir /home/container/.steam/sdk64 $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '-os windows' ) -app 1007
chmod +x $HOME/*

else
./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) $( [[ "${STEAM_SDK}" == "1" ]] && printf %s '+app_update 1007' ) +app_update ${STEAM_APPID} $( [[ -z ${STEAM_BETAID} ]] || printf %s "-beta ${STEAM_BETAID}" ) $( [[ -z ${STEAM_BETAPASS} ]] || printf %s "-betapassword ${STEAM_BETAPASS}" ) ${INSTALL_FLAGS} $( [[ "${VALIDATE}" == "1" ]] && printf %s 'validate' ) +quit
fi
else
echo -e "${BLUE}----------------------------------------------------------------------------------${NC}"
echo -e "${YELLOW}Not updating game server as auto update was set to 0.${NC}"
echo -e "${BLUE}----------------------------------------------------------------------------------${NC}"
echo -e "${BLUE}---------------------------------------------------------------${NC}"
echo -e "${YELLOW}Not updating game server as auto update was set to 0. Starting Server${NC}"
echo -e "${BLUE}---------------------------------------------------------------${NC}"
fi

echo -e "${BLUE}----------------------------------------------------------------------------------${NC}"
Expand Down
15 changes: 11 additions & 4 deletions steamcmd/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ echo -e "${BLUE}----------------------------------------------------------------
## just in case someone removed the defaults.
if [ "${STEAM_USER}" == "" ]; then
echo -e "${BLUE}---------------------------------------------------------------------${NC}"
echo -e "${YELLOW}Steam user is not set. ${NC}"
echo -e "${YELLOW}Using anonymous user.${NC}"
echo -e "${YELLOW}Steam user is not set.\n ${NC}"
echo -e "${YELLOW}Using anonymous user.\n ${NC}"
echo -e "${BLUE}---------------------------------------------------------------------${NC}"
STEAM_USER=anonymous
STEAM_PASS=""
Expand All @@ -51,8 +51,15 @@ fi

## if auto_update is not set or to 1 update
if [ -z ${AUTO_UPDATE} ] || [ "${AUTO_UPDATE}" == "1" ]; then
# Update Source Server
./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) $( [[ "${STEAM_SDK}" == "1" ]] && printf %s '+app_update 1007' ) +app_update ${STEAM_APPID} $( [[ -z ${STEAM_BETAID} ]] || printf %s "-beta ${STEAM_BETAID}" ) $( [[ -z ${STEAM_BETAPASS} ]] || printf %s "-betapassword ${STEAM_BETAPASS}" ) ${INSTALL_FLAGS} $( [[ "${VALIDATE}" == "1" ]] && printf %s 'validate' ) +quit
if [ -f /home/container/DepotDownloader ]; then
./DepotDownloader -dir /home/container -username ${STEAM_USER} -password ${STEAM_PASS} -remember-password $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '-os windows' ) -app ${STEAM_APPID} $( [[ -z ${STEAM_BETAID} ]] || printf %s "-beta ${STEAM_BETAID}" ) $( [[ -z ${STEAM_BETAPASS} ]] || printf %s "-betapassword ${STEAM_BETAPASS}" )
mkdir -p /home/container/.steam/sdk64
./DepotDownloader -dir /home/container/.steam/sdk64 $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '-os windows' ) -app 1007
chmod +x $HOME/*

else
./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) $( [[ "${STEAM_SDK}" == "1" ]] && printf %s '+app_update 1007' ) +app_update ${STEAM_APPID} $( [[ -z ${STEAM_BETAID} ]] || printf %s "-beta ${STEAM_BETAID}" ) $( [[ -z ${STEAM_BETAPASS} ]] || printf %s "-betapassword ${STEAM_BETAPASS}" ) ${INSTALL_FLAGS} $( [[ "${VALIDATE}" == "1" ]] && printf %s 'validate' ) +quit
fi
else
echo -e "${BLUE}---------------------------------------------------------------${NC}"
echo -e "${YELLOW}Not updating game server as auto update was set to 0. Starting Server${NC}"
Expand Down

0 comments on commit 452793a

Please sign in to comment.