Merge pull request #174 from jepugs/master

Fixed total memory detection on OpenBSD.
This commit is contained in:
Brett Bohnenkamper
2015-03-26 23:25:13 -10:00

View File

@@ -995,7 +995,7 @@ detectmem () {
used_mem=$(($round_mem - $avail_mem))
usedmem=$(($used_mem / ($human * $human) ))
elif [ "$distro" == "OpenBSD" ]; then
totalmem=$(top -1 1 | awk '/Real:/ {k=split($3,a,"/");print a[k] }' | tr -d 'M')
totalmem=`dmesg | grep 'real mem' | cut -d' ' -f5 | tr -d '()MB'`
usedmem=$(top -1 1 | awk '/Real:/ {print $3}' | sed 's/M.*//')
elif [ "$distro" == "NetBSD" ]; then
phys_mem=$(awk '/MemTotal/ { print $2 }' /proc/meminfo)