Explorar o código

added physicalmemavailable n/a for older distros

Daniel Gibbs %!s(int64=8) %!d(string=hai) anos
pai
achega
acd39bfbcd
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      lgsm/functions/info_distro.sh

+ 3 - 0
lgsm/functions/info_distro.sh

@@ -78,6 +78,9 @@ 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
+	physmemavailable="n/a"
+fi
 physmemcached=$(free ${humanreadable} | awk '/cache:/ {print $4}')
 if [ -z "${physmemcached}" ]; then
 	physmemcached=$(free ${humanreadable} | awk '/Mem:/ {print $6}')