Sfoglia il codice sorgente

Should fix missing cached mem #1143

Please, test on ubuntu to confirm it's working
UltimateByte 9 anni fa
parent
commit
5e737a997a
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      lgsm/functions/info_distro.sh

+ 3 - 0
lgsm/functions/info_distro.sh

@@ -73,6 +73,9 @@ physmemtotalmb=$(free -m | awk '/Mem:/ {print $2}')
 physmemused=$(free ${humanreadable} | awk '/Mem:/ {print $3}')
 physmemfree=$(free ${humanreadable} | awk '/Mem:/ {print $4}')
 physmemcached=$(free ${humanreadable} | awk '/cache:/ {print $4}')
+if [ -z "${physmemcached} ]; then
+	physmemcached=$(free ${humanreadable} | awk '/Mem:/ {print $5}')
+fi
 swaptotal=$(free ${humanreadable} | awk '/Swap:/ {print $2}')
 swapused=$(free ${humanreadable} | awk '/Swap:/ {print $3}')
 swapfree=$(free ${humanreadable} | awk '/Swap:/ {print $4}')