Browse Source

Cached details to be removed from older version of free as confusing

pull/1936/head
Daniel Gibbs 7 years ago
parent
commit
72771776e6
  1. 13
      lgsm/functions/info_distro.sh

13
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}')

Loading…
Cancel
Save