From 7dc37b5e4d6facb5dce8b90cd5139f837df0a6b9 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 17 Jun 2018 17:26:55 +0100 Subject: [PATCH] Updated RAM usage to work with changes to free command --- lgsm/functions/info_distro.sh | 3 ++- lgsm/functions/info_messages.sh | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 1eac29ab4..9fe2547a3 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -77,9 +77,10 @@ physmemtotal=$(free ${humanreadable} | awk '/Mem:/ {print $2}') physmemtotalmb=$(free -m | awk '/Mem:/ {print $2}') physmemused=$(free ${humanreadable} | awk '/Mem:/ {print $3}') physmemfree=$(free ${humanreadable} | awk '/Mem:/ {print $4}') +physmemavailable=$(free ${humanreadable} | awk '/Mem:/ {print $7}') physmemcached=$(free ${humanreadable} | awk '/cache:/ {print $4}') if [ -z "${physmemcached}" ]; then - physmemcached=$(free ${humanreadable} | awk '/Mem:/ {print $5}') + physmemcached=$(free ${humanreadable} | awk '/Mem:/ {print $6}') fi swaptotal=$(free ${humanreadable} | awk '/Swap:/ {print $2}') swapused=$(free ${humanreadable} | awk '/Swap:/ {print $3}') diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index bb6fc00f9..a5283c2f1 100644 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -71,8 +71,8 @@ fn_info_message_performance(){ } | column -s $'\t' -t echo -e "" { - echo -e "${blue}Mem:\t${blue}total\t used\t free\t cached${default}" - echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}${default}" + echo -e "${blue}Mem:\t${blue}total\t used\t free\t cached\t available${default}" + echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}\t${physmemavailable}${default}" echo -e "${blue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}" } | column -s $'\t' -t }