|
@@ -2,23 +2,52 @@
|
|
|
# LGSM fn_steaminstall function
|
|
# LGSM fn_steaminstall function
|
|
|
# Author: Daniel Gibbs
|
|
# Author: Daniel Gibbs
|
|
|
# Website: http://danielgibbs.co.uk
|
|
# Website: http://danielgibbs.co.uk
|
|
|
-# Version: 060115
|
|
|
|
|
|
|
+# Version: 110115
|
|
|
|
|
|
|
|
fn_steaminstallcommand(){
|
|
fn_steaminstallcommand(){
|
|
|
counter="0"
|
|
counter="0"
|
|
|
while [ "${counter}" == "0" ]||[ "$(grep -wc 0x402 .fn_steaminstall.tmp)" -ge "1" ]||[ "$(grep -wc 0x406 .fn_steaminstall.tmp)" -ge "1" ]||[ "$(grep -wc 0x6 .fn_steaminstall.tmp)" -ge "1" ]||[ "$(grep -wc 0x106 .fn_steaminstall.tmp)" -ge "1" ]; do
|
|
while [ "${counter}" == "0" ]||[ "$(grep -wc 0x402 .fn_steaminstall.tmp)" -ge "1" ]||[ "$(grep -wc 0x406 .fn_steaminstall.tmp)" -ge "1" ]||[ "$(grep -wc 0x6 .fn_steaminstall.tmp)" -ge "1" ]||[ "$(grep -wc 0x106 .fn_steaminstall.tmp)" -ge "1" ]; do
|
|
|
counter=$((counter+1))
|
|
counter=$((counter+1))
|
|
|
if [ "${counter}" -le "10" ]; then
|
|
if [ "${counter}" -le "10" ]; then
|
|
|
|
|
+ # Attempt 1-4: Standard attempt
|
|
|
|
|
+ # Attempt 5-6: Validate attempt
|
|
|
|
|
+ # Attempt 7-8: Validate, delete long name dir
|
|
|
|
|
+ # Attempt 9-10: Validate, delete long name dir, re-download SteamCMD
|
|
|
|
|
+ # Attempt 11: Failure
|
|
|
|
|
+
|
|
|
if [ "${counter}" -ge "2" ]; then
|
|
if [ "${counter}" -ge "2" ]; then
|
|
|
- fn_printwarningnl "SteamCMD did not complete the download, retrying: Attempt ${counter}"
|
|
|
|
|
|
|
+ fn_printwarningnl "SteamCMD did not complete the download, retrying: Attempt ${counter}:"
|
|
|
|
|
+ fi
|
|
|
|
|
+
|
|
|
|
|
+ if [ "${counter}" -ge "7" ]; then
|
|
|
|
|
+ echo "Removing $(find ${filesdir} -type d -print0 | grep -Ez '[^/]{30}$')"
|
|
|
|
|
+ find ${filesdir} -type d -print0 | grep -Ez '[^/]{30}$' | xargs -0 rm -rf
|
|
|
|
|
+ fi
|
|
|
|
|
+ if [ "${counter}" -ge "9" ]; then
|
|
|
|
|
+ rm -rf "${rootdir}/steamcmd"
|
|
|
|
|
+ fn_steamdl
|
|
|
|
|
+ fi
|
|
|
|
|
+ if [ "${counter}" -le "4" ]; then
|
|
|
|
|
+ ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit |tee .fn_steaminstall.tmp
|
|
|
|
|
+ elif [ "${counter}" -ge "5" ]; then
|
|
|
|
|
+ ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" -validate +quit |tee .fn_steaminstall.tmp
|
|
|
fi
|
|
fi
|
|
|
- ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit |tee .fn_steaminstall.tmp
|
|
|
|
|
elif [ "${counter}" -ge "11" ]; then
|
|
elif [ "${counter}" -ge "11" ]; then
|
|
|
fn_printfailurenl "SteamCMD did not complete the download, too many retrys"
|
|
fn_printfailurenl "SteamCMD did not complete the download, too many retrys"
|
|
|
break
|
|
break
|
|
|
fi
|
|
fi
|
|
|
- echo "0x402" > .fn_steaminstall.tmp
|
|
|
|
|
|
|
+
|
|
|
done
|
|
done
|
|
|
|
|
+
|
|
|
|
|
+# Goldsource servers commonly fail to download all the server files required.
|
|
|
|
|
+# Validating a few of times may reduce the chance of this issue.
|
|
|
|
|
+if [ "${engine}" == "goldsource" ]; then
|
|
|
|
|
+ counter="0"
|
|
|
|
|
+ while [ "${counter}" <= "4" ]; do
|
|
|
|
|
+ counter=$((counter+1))
|
|
|
|
|
+ ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" -validate +quit |tee .fn_steaminstall.tmp
|
|
|
|
|
+ done
|
|
|
|
|
+fi
|
|
|
rm -f .fn_steaminstall.tmp
|
|
rm -f .fn_steaminstall.tmp
|
|
|
}
|
|
}
|
|
|
|
|
|