physmem is 32bit on netbsd, physmem64 for 64bit

This commit is contained in:
coypoop 2016-10-16 09:01:16 +03:00 committed by GitHub
parent b937782e0e
commit 04685755c1

View file

@ -1172,7 +1172,10 @@ getmemory() {
*) memfree="$(($(vmstat | awk 'END{printf $5}') / 1024))" ;;
esac
memtotal="$(($(sysctl -n hw.physmem) / 1024 / 1024))"
case "$distro" in
"NetBSD"*) memtotal="$(($(sysctl -n hw.physmem64) / 1024 / 1024))" ;;
*) memtotal="$(($(sysctl -n hw.physmem) / 1024 / 1024))" ;;
esac
memused="$((memtotal - memfree))"
;;