explorer/memory: Support OpenBSD (#602)

Adds support to detect the amount of memory available on OpenBSD
systems.
This commit is contained in:
uqam-fob 2017-11-15 01:31:17 -05:00 committed by Darko Poljak
parent 0bf6af6d22
commit 3b6a471119
1 changed files with 5 additions and 0 deletions

View File

@ -2,6 +2,7 @@
#
# 2014 Daniel Heule (hda at sfs.biz)
# 2014 Thomas Oettli (otho at sfs.biz)
# Copyright 2017, Philippe Gregoire <pg@pgregoire.xyz>
#
# This file is part of cdist.
#
@ -28,6 +29,10 @@ case "$os" in
echo "$(sysctl -n hw.memsize)/1024" | bc
;;
"openbsd")
echo "$(sysctl -n hw.physmem) / 1048576" | bc
;;
*)
if [ -r /proc/meminfo ]; then
grep "MemTotal:" /proc/meminfo | awk '{print $2}'