Contents of /mcore-src/trunk/mcore-tools/src/modules/hwinfo/hardware.control.class.in
Parent Directory | Revision Log
Revision 2487 -
(show annotations)
(download)
Thu Sep 10 13:05:37 2015 UTC (8 years, 8 months ago) by niro
File size: 1428 byte(s)
Thu Sep 10 13:05:37 2015 UTC (8 years, 8 months ago) by niro
File size: 1428 byte(s)
-added set_hardware_detection() to hardware.control.class
1 | # $Id$ |
2 | |
3 | require hwdetection |
4 | require mysql |
5 | |
6 | set_hardware_detect() |
7 | { |
8 | local serial="${CLASS_ARGV[0]}" |
9 | |
10 | local cmd |
11 | local netcard_driver |
12 | local graphic_driver |
13 | local monitor_info |
14 | local monitor_resolution |
15 | |
16 | nsslsay_queue_init |
17 | nsslsay_queue_add "nocolors" |
18 | nsslsay_queue_add "get hardware.detect driver netcard" |
19 | netcard_driver=$(control_client "${serial}" run-queue) |
20 | if [[ -n ${netcard_driver} ]] |
21 | then |
22 | decho "netcard_driver='${netcard_driver}'" |
23 | import_resource cfg_network "${serial}" module "${netcard_driver}" |
24 | # set network to dhcp |
25 | import_resource cfg_network "${serial}" networking "dhcp" |
26 | else |
27 | decho "no netcard_driver found" |
28 | fi |
29 | |
30 | nsslsay_queue_init |
31 | nsslsay_queue_add "nocolors" |
32 | nsslsay_queue_add "get hardware.detect driver graphic" |
33 | graphic_driver=$(control_client "${serial}" run-queue) |
34 | if [[ -n ${graphic_driver} ]] |
35 | then |
36 | decho "graphic_driver='${graphic_driver}'" |
37 | import_resource cfg_graphic "${serial}" module "${graphic_driver}" |
38 | else |
39 | decho "no graphic_driver found" |
40 | fi |
41 | |
42 | nsslsay_queue_init |
43 | nsslsay_queue_add "nocolors" |
44 | nsslsay_queue_add "get hardware.detect info minitor" |
45 | monitor_info=$(control_client "${serial}" run-queue) |
46 | monitor_resolution="${monitor_info##*;}" |
47 | if [[ -n ${monitor_resolution} ]] |
48 | then |
49 | decho "monitor_resolution='${monitor_resolution}'" |
50 | import_resource cfg_graphic "${serial}" resolution "${monitor_resolution}" |
51 | else |
52 | decho "no monitor_resolution found" |
53 | fi |
54 | } |