5 |
# get_hwinfo $hw_item |
# get_hwinfo $hw_item |
6 |
get_hwinfo() |
get_hwinfo() |
7 |
{ |
{ |
8 |
|
local enable_desc="0" |
9 |
|
|
10 |
|
if [[ $1 = --with-description ]] || [[ $1 = -d ]] |
11 |
|
then |
12 |
|
enable_desc=1 |
13 |
|
shift |
14 |
|
fi |
15 |
|
|
16 |
local item="$1" |
local item="$1" |
17 |
local all |
local all |
18 |
local i |
local i |
25 |
(( i++ )) |
(( i++ )) |
26 |
[ ${i} -eq 1 ] && continue |
[ ${i} -eq 1 ] && continue |
27 |
|
|
28 |
echo "${device};${description}" |
if [[ ${enable_desc} = 1 ]] |
29 |
|
then |
30 |
|
echo "${device};${description}" |
31 |
|
else |
32 |
|
echo "${device}" |
33 |
|
fi |
34 |
done <<< "${all}" |
done <<< "${all}" |
35 |
} |
} |
36 |
|
|
57 |
local i |
local i |
58 |
for i in $(hwinfo --"${item}" | grep "Driver Modules:" | cut -d: -f2 ) |
for i in $(hwinfo --"${item}" | grep "Driver Modules:" | cut -d: -f2 ) |
59 |
do |
do |
60 |
eval $(echo "${i}" | sed -e "s:\":modules=\"\${modules}\ :" -e "s:\",\ \":\ :") |
eval $(echo "${i}" | sed -e "s:\":modules=\"\${modules}\ :" -e "s:,:\ :") |
61 |
done |
done |
62 |
echo "${modules}" |
echo "${modules}" |
63 |
} |
} |
78 |
done |
done |
79 |
|
|
80 |
# remove all ':' and show the cleaned list |
# remove all ':' and show the cleaned list |
81 |
echo "${fixed_list}" | sed "s|:| |g" |
# this way fixes double spaces also |
82 |
|
for i in $(echo ${fixed_list} | sed "s|:| |g") |
83 |
|
do |
84 |
|
echo "${i}" |
85 |
|
done |
86 |
} |
} |
87 |
|
|
88 |
get_x11_driver_modules() |
get_x11_driver_modules() |
164 |
#get_driver_modules all |
#get_driver_modules all |
165 |
|
|
166 |
# network |
# network |
167 |
#get_hwinfo netcard |
#get_hwinfo --with-description netcard |
168 |
#get_driver_modules netcard |
#get_driver_modules netcard |
169 |
|
|
170 |
#get_hwinfo disk |
#get_hwinfo disk |