| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #!/bin/bash
- # LGSM fn_steaminstall function
- # Author: Daniel Gibbs
- # Website: http://danielgibbs.co.uk
- # Version: 060115
- fn_steaminstallcommand(){
- 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
- counter=$((counter+1))
- if [ "${counter}" -le "10" ]; then
- if [ "${counter}" -ge "2" ]; then
- fn_printwarningnl "SteamCMD did not complete the download, retrying: Attempt ${counter}"
- fi
- ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit |tee .fn_steaminstall.tmp
- elif [ "${counter}" -ge "11" ]; then
- fn_printfailurenl "SteamCMD did not complete the download, too many retrys"
- break
- fi
- echo "0x402" > .fn_steaminstall.tmp
- done
- rm -f .fn_steaminstall.tmp
- }
- echo ""
- echo "Installing ${gamename} Server"
- echo "================================="
- sleep 1
- mkdir -pv "${filesdir}"
- cd "${rootdir}/steamcmd"
- fn_steaminstallcommand
- if [ -z "${autoinstall}" ]; then
- echo ""
- echo "================================="
- while true; do
- read -p "Was the install successful? [y/N]" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) fn_retryinstall;;
- * ) echo "Please answer yes or no.";;
- esac
- done
- fi
|