16 |
local item="$1" |
local item="$1" |
17 |
local all |
local all |
18 |
local i |
local i |
19 |
|
|
20 |
|
# handle special items |
21 |
|
case ${item} in |
22 |
|
memory) get_hwinfo_memory; return ;; |
23 |
|
smp) get_hwinfo_smp; return ;; |
24 |
|
esac |
25 |
|
|
26 |
all=$(hwinfo --short --"${item}") |
all=$(hwinfo --short --"${item}") |
27 |
|
|
28 |
declare -i i=0 |
declare -i i=0 |
41 |
done <<< "${all}" |
done <<< "${all}" |
42 |
} |
} |
43 |
|
|
44 |
|
|
45 |
|
# special memory case |
46 |
|
get_hwinfo_memory() |
47 |
|
{ |
48 |
|
local memory=$(hwinfo --memory | grep "Memory Size" | cut -d: -f2 | sed "s:\ ::") |
49 |
|
echo "${memory}" |
50 |
|
} |
51 |
|
|
52 |
|
|
53 |
|
# special smp case |
54 |
|
get_hwinfo_smp() |
55 |
|
{ |
56 |
|
local smp=$(hwinfo --smp | grep "SMP support:" | cut -d: -f2 | sed "s:\ ::") |
57 |
|
echo "${smp}" |
58 |
|
} |
59 |
|
|
60 |
|
|
61 |
# get_driver_modules $hw_item |
# get_driver_modules $hw_item |
62 |
get_driver_modules() |
get_driver_modules() |
63 |
{ |
{ |