Magellan Linux

Contents of /mcore-src/trunk/mcore-tools/src/modules/hwinfo/hardware.control.class.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2495 - (show annotations) (download)
Thu Sep 10 13:50:46 2015 UTC (8 years, 7 months ago) by niro
File size: 2059 byte(s)
-fixed whitespaces
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 else
25 decho "no netcard_driver found"
26 fi
27 if [[ -z $(mysqldo "select networking from cfg_network where serial=${serial};") ]]
28 then
29 # set network to dhcp
30 decho "networking='dhcp'"
31 import_resource cfg_network "${serial}" networking "dhcp"
32 fi
33 if [[ -z $(mysqldo "select hostname from cfg_network where serial=${serial};") ]]
34 then
35 # set hostname to MCORE_DEFAULT_HOSTNAME
36 decho "hostname='${MCORE_DEFAULT_HOSTNAME}'"
37 import_resource cfg_network "${serial}" hostname "${MCORE_DEFAULT_HOSTNAME}"
38 fi
39 if [[ -z $(mysqldo "select domain from cfg_network where serial=${serial};") ]]
40 then
41 # set domain to MCORE_DEFAULT_DOMAIN
42 decho "hostname='${MCORE_DEFAULT_DOMAIN}'"
43 import_resource cfg_network "${serial}" domain "${MCORE_DEFAULT_DOMAIN}"
44 fi
45
46 nsslsay_queue_init
47 nsslsay_queue_add "nocolors"
48 nsslsay_queue_add "get hardware.detect driver graphic"
49 graphic_driver=$(control_client "${serial}" run-queue)
50 if [[ -n ${graphic_driver} ]]
51 then
52 decho "graphic_driver='${graphic_driver}'"
53 import_resource cfg_graphic "${serial}" module "${graphic_driver}"
54 else
55 decho "no graphic_driver found"
56 fi
57
58 nsslsay_queue_init
59 nsslsay_queue_add "nocolors"
60 nsslsay_queue_add "get hardware.detect info monitor"
61 monitor_info=$(control_client "${serial}" run-queue)
62 monitor_resolution="${monitor_info##*;}"
63 if [[ -n ${monitor_resolution} ]]
64 then
65 decho "monitor_resolution='${monitor_resolution}'"
66 import_resource cfg_graphic "${serial}" resolution "${monitor_resolution}"
67 else
68 decho "no monitor_resolution found"
69 fi
70 }