4
0

fn_steaminstall 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. # LGSM fn_steaminstall function
  3. # Author: Daniel Gibbs
  4. # Website: http://danielgibbs.co.uk
  5. # Version: 281214
  6. fn_steaminstallcommand(){
  7. echo "0x402" > .fn_steaminstall.tmp
  8. while [ "$(grep -c 0x402 .fn_steaminstall.tmp)" -ge "1" ]; do
  9. counter=$((counter+1))
  10. if [ "${counter}" -le "10" ]; then
  11. if [ "${counter}" -ge "2" ]; then
  12. fn_printwarningnl "SteamCMD did not complete the download, retrying: Attempt ${counter}"
  13. fi
  14. ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit |tee .fn_steaminstall.tmp
  15. elif [ "${counter}" -ge "11" ]; then
  16. fn_printfailurenl "SteamCMD did not complete the download, too many retrys"
  17. break
  18. fi
  19. done
  20. rm -f .fn_steaminstall.tmp
  21. }
  22. echo ""
  23. echo "Installing ${gamename} Server"
  24. echo "================================="
  25. sleep 1
  26. mkdir -pv "${filesdir}"
  27. cd "${rootdir}/steamcmd"
  28. fn_steaminstallcommand
  29. if [ -z "${autoinstall}" ]; then
  30. echo ""
  31. echo "================================="
  32. while true; do
  33. read -p "Was the install successful? [y/N]" yn
  34. case $yn in
  35. [Yy]* ) break;;
  36. [Nn]* ) fn_retryinstall;;
  37. * ) echo "Please answer yes or no.";;
  38. esac
  39. done
  40. fi