Merge branch 'evilham-explorers' into 'master'

[explorers] Improve *BSD support.

See merge request ungleich-public/cdist!869
This commit is contained in:
poljakowski 2020-04-27 22:53:09 +02:00
commit cd0c811d74
2 changed files with 5 additions and 1 deletions

View file

@ -32,6 +32,10 @@ case "$os" in
sysctl -n hw.ncpuonline sysctl -n hw.ncpuonline
;; ;;
"freebsd"|"netbsd")
sysctl -n hw.ncpu
;;
*) *)
if [ -r /proc/cpuinfo ]; then if [ -r /proc/cpuinfo ]; then
cores="$(grep "core id" /proc/cpuinfo | sort | uniq | wc -l)" cores="$(grep "core id" /proc/cpuinfo | sort | uniq | wc -l)"

View file

@ -29,7 +29,7 @@ case "$os" in
echo "$(sysctl -n hw.memsize)/1024" | bc echo "$(sysctl -n hw.memsize)/1024" | bc
;; ;;
"openbsd") *"bsd")
echo "$(sysctl -n hw.physmem) / 1048576" | bc echo "$(sysctl -n hw.physmem) / 1048576" | bc
;; ;;