Merge pull request #739 from dne/openbsd-explorers
Support OpenBSD in "cpu_cores" and "disks" global explorers
This commit is contained in:
commit
66377d2c04
2 changed files with 20 additions and 3 deletions
|
@ -28,6 +28,10 @@ case "$os" in
|
|||
sysctl -n hw.physicalcpu
|
||||
;;
|
||||
|
||||
"openbsd")
|
||||
sysctl -n hw.ncpuonline
|
||||
;;
|
||||
|
||||
*)
|
||||
if [ -r /proc/cpuinfo ]; then
|
||||
cores="$(grep "core id" /proc/cpuinfo | sort | uniq | wc -l)"
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
#!/bin/sh
|
||||
cd /dev || exit 0
|
||||
echo sd? hd? vd?
|
||||
#!/bin/sh -e
|
||||
|
||||
os=$("$__explorer/os")
|
||||
case "$os" in
|
||||
openbsd)
|
||||
IFS=',' disks=$(sysctl -n hw.disknames)
|
||||
for d in $disks; do
|
||||
echo "${d%%:*}"
|
||||
done | sed -n '/^[sw]d[0-9][0-9]*/p'
|
||||
;;
|
||||
|
||||
*)
|
||||
cd /dev || exit 0
|
||||
echo sd? hd? vd?
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Reference in a new issue