explorer/memory: Support OpenBSD (#602)
Adds support to detect the amount of memory available on OpenBSD systems.
This commit is contained in:
parent
0bf6af6d22
commit
3b6a471119
1 changed files with 5 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
#
|
#
|
||||||
# 2014 Daniel Heule (hda at sfs.biz)
|
# 2014 Daniel Heule (hda at sfs.biz)
|
||||||
# 2014 Thomas Oettli (otho at sfs.biz)
|
# 2014 Thomas Oettli (otho at sfs.biz)
|
||||||
|
# Copyright 2017, Philippe Gregoire <pg@pgregoire.xyz>
|
||||||
#
|
#
|
||||||
# This file is part of cdist.
|
# This file is part of cdist.
|
||||||
#
|
#
|
||||||
|
@ -28,6 +29,10 @@ case "$os" in
|
||||||
echo "$(sysctl -n hw.memsize)/1024" | bc
|
echo "$(sysctl -n hw.memsize)/1024" | bc
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"openbsd")
|
||||||
|
echo "$(sysctl -n hw.physmem) / 1048576" | bc
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
if [ -r /proc/meminfo ]; then
|
if [ -r /proc/meminfo ]; then
|
||||||
grep "MemTotal:" /proc/meminfo | awk '{print $2}'
|
grep "MemTotal:" /proc/meminfo | awk '{print $2}'
|
||||||
|
|
Loading…
Reference in a new issue