Add DragonFly and Solaris (?) portability. SunOS is only test on
openindiana (SunOS 5.11 oi_151a2 i86pc i386 i86pc Solaris) Battery state is untested on those OS
This commit is contained in:
parent
e5f558c08d
commit
ead8a9ff41
@ -54,6 +54,8 @@ OS="Linux"
|
||||
case $(uname) in
|
||||
"Linux" ) OS="Linux" ;;
|
||||
"FreeBSD") OS="FreeBSD" ;;
|
||||
"DragonFly") OS="FreeBSD" ;;
|
||||
"SunOS") OS="SunOS" ;;
|
||||
esac
|
||||
|
||||
# Colors declarations
|
||||
@ -130,6 +132,11 @@ __cpunum_FreeBSD ()
|
||||
sysctl -n hw.ncpu
|
||||
}
|
||||
|
||||
__cpunum_SunOS ()
|
||||
{
|
||||
kstat -m cpu_info | grep "module: cpu_info" | wc -l
|
||||
}
|
||||
|
||||
__CPUNUM=$(__cpunum_$OS)
|
||||
|
||||
|
||||
@ -147,6 +154,12 @@ __load_FreeBSD()
|
||||
echo -n "$load"
|
||||
}
|
||||
|
||||
__load_SunOS()
|
||||
{
|
||||
load=$(LANG=C uptime | awk '{print $10}'| sed -e 's/,//')
|
||||
echo -n "$load"
|
||||
}
|
||||
|
||||
|
||||
###############
|
||||
# Who are we? #
|
||||
|
Loading…
Reference in New Issue
Block a user