From 0d4df73f17010360258d3938bac4b95cd5fa5f24 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 27 Jul 2016 22:22:01 +0100 Subject: [PATCH] using info_distro and updated messages --- lgsm/functions/check_system_requirements.sh | 32 +++++++++++---------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh index 53d09a93b..d9e56cc5f 100644 --- a/lgsm/functions/check_system_requirements.sh +++ b/lgsm/functions/check_system_requirements.sh @@ -3,24 +3,26 @@ # Author: Daniel Gibbs # Contributor: UltimateByte # Website: https://gameservermanagers.com -# Description: Checks RAM requirement +# Description: Checks RAM requirements -mbphysmem=$(free -m | awk '/Mem:/ {print $2}') +local commandname="CHECK" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -# RAM requirement in MegaBytes for each game or engine +info_distro.sh + +# RAM requirements in megabytes for each game or engine. if [ "${gamename}" == "Rust" ]; then - ramrequirement="4000" + ramrequirementmb="4000" + ramrequirementgb="4" fi -# If the game or engine has a minimum RAM Requirement, compare it to system's available RAM +# If the game or engine has a minimum RAM Requirement, compare it to system's available RAM. if [ -n "${ramrequirement}" ]; then - if [ "${mbphysmem}" -lt "${ramrequirement}" ]; then - # Warn the user - fn_print_warn "Insufficient physical RAM: ${mbphysmem}MB available for ${ramrequirement}MB required." - sleep 2 - echo "" - echo "You may encounter issues such as server lagging or shutting down unexpectedly." - sleep 0.5 - fn_script_log_warn "Insufficient physical RAM: ${mbphysmem}MB available for ${ramrequirement}MB required." - fi -fi + if [ "${physmemtotalmb}" -lt "${ramrequirementmb}" ]; then + # Warn the user + fn_print_warn "Insufficient memory: ${ramrequirementgb}G required, ${physmemtotal} available" + sleep 1 + fn_print_warning "You may experiance poor performance from your server" + sleep 1 + fi +fi