fn_steamdl 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/bash
  2. # LGSM fn_steamdl function
  3. # Author: Daniel Gibbs
  4. # Website: http://danielgibbs.co.uk
  5. # Version: 090115
  6. # Description: Downloads SteamCMD on install and checks if missing before running functions that require SteamCMD
  7. if [ "${gamename}" == "Unreal Tournament 99" ]||[ "${modulename}" == "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_printwarn "SteamCMD is missing"
  14. fn_scriptlog "SteamCMD is missing"
  15. sleep 1
  16. echo -en "\n"
  17. mkdir -pv "${rootdir}/steamcmd"
  18. cd "${rootdir}/steamcmd"
  19. echo -e "downloading steamcmd_linux.tar.gz...\c"
  20. wget -N --no-check-certificate /dev/null http://media.steampowered.com/client/steamcmd_linux.tar.gz 2>&1 | grep -F HTTP | cut -c45-| uniq
  21. tar --verbose -zxf steamcmd_linux.tar.gz
  22. rm -v steamcmd_linux.tar.gz
  23. chmod +x steamcmd.sh
  24. fn_scriptlog "Re-installed SteamCMD"
  25. fn_printdots "${servername}"
  26. sleep 1
  27. fi
  28. cd "${rootdir}"
  29. else
  30. echo ""
  31. echo "Installing SteamCMD"
  32. echo "================================="
  33. cd "${rootdir}"
  34. mkdir -pv "steamcmd"
  35. sleep 1
  36. cd "steamcmd"
  37. if [ ! -f steamcmd.sh ]; then
  38. echo -e "downloading steamcmd_linux.tar.gz...\c"
  39. wget -N --no-check-certificate /dev/null http://media.steampowered.com/client/steamcmd_linux.tar.gz 2>&1 | grep -F HTTP | cut -c45-| uniq
  40. tar --verbose -zxf steamcmd_linux.tar.gz
  41. rm -v steamcmd_linux.tar.gz
  42. chmod +x steamcmd.sh
  43. sleep 1
  44. else
  45. echo "Steam already installed!"
  46. fi
  47. sleep 1
  48. fi