less indirections, directly call FreeBSD primitives

This commit is contained in:
nojhan 2012-07-30 21:22:16 +02:00
parent f4135f142e
commit a00de370c5

View File

@ -74,7 +74,7 @@ OS="Linux"
case $(uname) in case $(uname) in
"Linux" ) OS="Linux" ;; "Linux" ) OS="Linux" ;;
"FreeBSD") OS="FreeBSD" ;; "FreeBSD") OS="FreeBSD" ;;
"Darwin") OS="Darwin" ;; "Darwin") OS="FreeBSD" ;;
"DragonFly") OS="FreeBSD" ;; "DragonFly") OS="FreeBSD" ;;
"SunOS") OS="SunOS" ;; "SunOS") OS="SunOS" ;;
esac esac
@ -153,11 +153,6 @@ __cpunum_FreeBSD()
sysctl -n hw.ncpu sysctl -n hw.ncpu
} }
__cpunum_Darwin()
{
__cpunum_FreeBSD
}
__cpunum_SunOS() __cpunum_SunOS()
{ {
kstat -m cpu_info | grep "module: cpu_info" | wc -l kstat -m cpu_info | grep "module: cpu_info" | wc -l
@ -180,11 +175,6 @@ __load_FreeBSD()
echo -n "$load" echo -n "$load"
} }
__load_Darwin()
{
__load_FreeBSD
}
__load_SunOS() __load_SunOS()
{ {
load=$(LANG=C uptime | awk '{print $10}'| sed -e 's/,//') load=$(LANG=C uptime | awk '{print $10}'| sed -e 's/,//')