diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index e4ad418ba..ea345d0a3 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -77,14 +77,15 @@ 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}') -if [ -z "${physmemavailable}" ]; then +oldfree=$(free ${humanreadable} | awk '/cache:/') +if [ -n "${oldfree}" ]; then physmemavailable="n/a" + physmemcached="n/a" +else + physmemavailable=$(free ${humanreadable} | awk '/Mem:/ {print $7}') + physmemcached=$(free ${humanreadable} | awk '/Mem:/ {print $5}') fi -physmemcached=$(free ${humanreadable} | awk '/cache:/ {print $4}') -if [ -z "${physmemcached}" ]; then - physmemcached=$(free ${humanreadable} | awk '/Mem:/ {print $6}') -fi + swaptotal=$(free ${humanreadable} | awk '/Swap:/ {print $2}') swapused=$(free ${humanreadable} | awk '/Swap:/ {print $3}') swapfree=$(free ${humanreadable} | awk '/Swap:/ {print $4}')