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