fn_check_steamcmd 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. # LGSM fn_check_steamcmd function
  3. # Author: Daniel Gibbs
  4. # Website: http://danielgibbs.co.uk
  5. # Version: 210115
  6. # Description: Downloads SteamCMD on install and checks if missing before running functions that require SteamCMD
  7. if [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament 2004" ]; then
  8. : # These servers do not require SteamCMD. Check is skipped.
  9. elif [ "${modulename}" == "Starting" ]||[ "${modulename}" == "Update" ]; then
  10. # Checks if SteamCMD exists when starting or updating a server.
  11. # Re-installs if missing.
  12. if [ ! -f ${rootdir}/steamcmd/steamcmd.sh ]; then
  13. fn_details_config
  14. fn_printwarn "SteamCMD is missing"
  15. fn_scriptlog "SteamCMD is missing"
  16. sleep 1
  17. echo -en "\n"
  18. mkdir -pv "${rootdir}/steamcmd"
  19. cd "${rootdir}/steamcmd"
  20. echo -e "downloading steamcmd_linux.tar.gz...\c"
  21. wget -N --no-check-certificate /dev/null http://media.steampowered.com/client/steamcmd_linux.tar.gz 2>&1 | grep -F HTTP | cut -c45-| uniq
  22. tar --verbose -zxf steamcmd_linux.tar.gz
  23. rm -v steamcmd_linux.tar.gz
  24. chmod +x steamcmd.sh
  25. fn_scriptlog "Re-installed SteamCMD"
  26. fn_printdots "${servername}"
  27. sleep 1
  28. fi
  29. cd "${rootdir}"
  30. fi