check_system_requirements.sh 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 gigabytes 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}" == "sm" ]; then
  49. ramrequirementgb="10"
  50. elif [ "${shortname}" == "st" ]; then
  51. ramrequirementgb="1"
  52. elif [ "${shortname}" == "stn" ]; then
  53. ramrequirementgb="3"
  54. elif [ "${shortname}" == "tu" ]; then
  55. ramrequirementgb="2"
  56. elif [ "${shortname}" == "vh" ]; then
  57. ramrequirementgb="2"
  58. else
  59. ramrequirementgb="0.5"
  60. fi
  61. # If the game or engine has a minimum RAM Requirement, compare it to system's available RAM.
  62. if [ "${ramrequirementgb}" ]; then
  63. if (($(echo "${physmemtotalgb} < ${ramrequirementgb}" | bc -l))); then
  64. fn_print_dots "Checking RAM"
  65. fn_print_warn_nl "Checking RAM: ${ramrequirementgb}G required, ${physmemtotal} available"
  66. echo "* ${gamename} server may fail to run or experience poor performance."
  67. fn_sleep_time_5
  68. fi
  69. fi