Skip to content

Commit 38b2938

Browse files
authored
Merge pull request #155 from joedwards32/142-server-gets-error-when-attempting-to-update
142 server gets error when attempting to update
2 parents 52ddac6 + c225ca3 commit 38b2938

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

bookworm/etc/entry.sh

+21-1
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,32 @@ else
2424
VALIDATE=""
2525
fi
2626

27-
eval bash "${STEAMCMDDIR}/steamcmd.sh" "${STEAMCMD_SPEW}"\
27+
## SteamCMD can fail to download
28+
## Retry logic
29+
MAX_ATTEMPTS=3
30+
attempt=0
31+
while [[ $steamcmd_rc != 0 ]] && [[ $attempt -lt $MAX_ATTEMPTS ]]; do
32+
((attempt+=1))
33+
if [[ $attempt -gt 1 ]]; then
34+
echo "Retrying SteamCMD, attempt ${attempt}"
35+
# Stale appmanifest data can lead for HTTP 401 errors when requesting old
36+
# files from SteamPipe CDN
37+
echo "Removing steamapps (appmanifest data)..."
38+
rm -rf "${STEAMAPPDIR}/steamapps"
39+
fi
40+
eval bash "${STEAMCMDDIR}/steamcmd.sh" "${STEAMCMD_SPEW}"\
2841
+force_install_dir "${STEAMAPPDIR}" \
2942
+@bClientTryRequestManifestWithoutCode 1 \
3043
+login anonymous \
3144
+app_update "${STEAMAPPID}" "${VALIDATE}"\
3245
+quit
46+
steamcmd_rc=$?
47+
done
48+
49+
## Exit if steamcmd fails
50+
if [[ $steamcmd_rc != 0 ]]; then
51+
exit $steamcmd_rc
52+
fi
3353

3454
# steamclient.so fix
3555
mkdir -p ~/.steam/sdk64

0 commit comments

Comments
 (0)