浏览代码

Merge branch 'ultimatebyte-dev' of https://github.com/GameServerManagers/LinuxGSM into ultimatebyte-dev

Daniel Gibbs 9 年之前
父节点
当前提交
f02c15e6b9
共有 1 个文件被更改,包括 3 次插入0 次删除
  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}')
 physmemused=$(free ${humanreadable} | awk '/Mem:/ {print $3}')
 physmemfree=$(free ${humanreadable} | awk '/Mem:/ {print $4}')
 physmemfree=$(free ${humanreadable} | awk '/Mem:/ {print $4}')
 physmemcached=$(free ${humanreadable} | awk '/cache:/ {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}')
 swaptotal=$(free ${humanreadable} | awk '/Swap:/ {print $2}')
 swapused=$(free ${humanreadable} | awk '/Swap:/ {print $3}')
 swapused=$(free ${humanreadable} | awk '/Swap:/ {print $3}')
 swapfree=$(free ${humanreadable} | awk '/Swap:/ {print $4}')
 swapfree=$(free ${humanreadable} | awk '/Swap:/ {print $4}')