check_system_requirements.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/bin/bash
  2. # LinuxGSM check_system_requirements.sh
  3. # Author: Daniel Gibbs
  4. # Contributors: http://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Checks RAM requirements.
  7. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. info_distro.sh
  9. # RAM requirements in megabytes for each game or engine.
  10. if [ "${shortname}" == "ark" ]; then
  11. ramrequirementgb="7"
  12. elif [ "${shortname}" == "arma3" ]; then
  13. ramrequirementgb="2"
  14. elif [ "${shortname}" == "armar" ]; then
  15. ramrequirementgb="3"
  16. elif [ "${shortname}" == "bt" ]; then
  17. ramrequirementgb="1"
  18. elif [ "${shortname}" == "cc" ]; then
  19. ramrequirementgb="1"
  20. elif [ "${shortname}" == "dayz" ]; then
  21. ramrequirementgb="5"
  22. elif [ "${shortname}" == "dodr" ]; then
  23. ramrequirementgb="2"
  24. elif [ "${shortname}" == "hw" ]; then
  25. ramrequirementgb="3"
  26. elif [ "${shortname}" == "mc" ]; then
  27. ramrequirementgb="1"
  28. elif [ "${shortname}" == "pmc" ]; then
  29. ramrequirementgb="2"
  30. elif [ "${shortname}" == "mh" ]; then
  31. ramrequirementgb="4"
  32. elif [ "${shortname}" == "ns2" ] || [ "${shortname}" == "ns2c" ]; then
  33. ramrequirementgb="1"
  34. elif [ "${shortname}" == "ps" ]; then
  35. ramrequirementgb="2"
  36. elif [ "${shortname}" == "pvr" ]; then
  37. ramrequirementgb="1"
  38. elif [ "${shortname}" == "pz" ]; then
  39. ramrequirementgb="3"
  40. elif [ "${shortname}" == "rust" ]; then
  41. ramrequirementgb="9"
  42. elif [ "${shortname}" == "sdtd" ]; then
  43. ramrequirementgb="4"
  44. elif [ "${shortname}" == "sf" ]; then
  45. ramrequirementgb="12"
  46. elif [ "${shortname}" == "squad" ]; then
  47. ramrequirementgb="2"
  48. elif [ "${shortname}" == "st" ]; then
  49. ramrequirementgb="1"
  50. elif [ "${shortname}" == "stn" ]; then
  51. ramrequirementgb="3"
  52. elif [ "${shortname}" == "tu" ]; then
  53. ramrequirementgb="2"
  54. elif [ "${shortname}" == "vh" ]; then
  55. ramrequirementgb="2"
  56. else
  57. ramrequirementgb="0.5"
  58. fi
  59. # If the game or engine has a minimum RAM Requirement, compare it to system's available RAM.
  60. if [ "${ramrequirementgb}" ]; then
  61. if [ "${physmemtotalgb}" -lt "${ramrequirementgb}" ]; then
  62. fn_print_dots "Checking RAM"
  63. fn_print_warn_nl "Checking RAM: ${ramrequirementgb}G required, ${physmemtotal} available"
  64. echo "* ${gamename} server may fail to run or experience poor performance."
  65. fn_sleep_time_5
  66. fi
  67. fi