[explorers] Improve *BSD support.

cpu_cores and memory did lacked support for other BSDs.
This commit is contained in:
evilham 2020-04-27 01:23:48 +02:00
parent 04b7f240eb
commit 678df1ec8a
2 changed files with 5 additions and 1 deletions

View File

@ -32,6 +32,10 @@ case "$os" in
sysctl -n hw.ncpuonline
;;
"freebsd"|"netbsd")
sysctl -n hw.ncpu
;;
*)
if [ -r /proc/cpuinfo ]; then
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
;;
"openbsd")
*"bsd")
echo "$(sysctl -n hw.physmem) / 1048576" | bc
;;