Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2493 by niro, Thu Sep 10 13:43:13 2015 UTC revision 2497 by niro, Thu Sep 10 14:08:40 2015 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2    
3    provide hardware
4  require hwdetection  require hwdetection
5  require mysql  require mysql
6    
# Line 9  set_hardware_detect() Line 10  set_hardware_detect()
10    
11   local cmd   local cmd
12   local netcard_driver   local netcard_driver
13     local networking
14     local hostname
15     local domain
16   local graphic_driver   local graphic_driver
17   local monitor_info   local monitor_info
18   local monitor_resolution   local monitor_resolution
19     local hwdetected
20    
21     # first check if hardware detect was already done
22     hwdetected=$(mysqldo "select hwdetected from client_serials where serial=${serial};")
23     if [[ ${hwdetected} = 1 ]]
24     then
25     decho "hardware detection already run, aborting"
26     return 0
27     fi
28    
29   nsslsay_queue_init   nsslsay_queue_init
30   nsslsay_queue_add "nocolors"   nsslsay_queue_add "nocolors"
# Line 19  set_hardware_detect() Line 32  set_hardware_detect()
32   netcard_driver=$(control_client "${serial}" run-queue)   netcard_driver=$(control_client "${serial}" run-queue)
33   if [[ -n ${netcard_driver} ]]   if [[ -n ${netcard_driver} ]]
34   then   then
35   decho "netcard_driver='${netcard_driver}'"   decho "netcard_driver='${netcard_driver}'"
36   import_resource cfg_network "${serial}" module "${netcard_driver}"   import_resource cfg_network "${serial}" module "${netcard_driver}"
37   else   else
38   decho "no netcard_driver found"   decho "no netcard_driver found"
39   fi   fi
40   if [[ -z $(mysqldo "select networking from cfg_network where serial=${serial};") ]]   networking=$(mysqldo "select networking from cfg_network where serial=${serial};")
41     if [[ -z ${networking} ]] || [[ ${networking} = NULL ]]
42   then   then
43   # set network to dhcp   # set network to dhcp
44   decho "networking='dhcp'"   decho "networking='dhcp'"
45   import_resource cfg_network "${serial}" networking "dhcp"   import_resource cfg_network "${serial}" networking "dhcp"
46   fi   fi
47   if [[ -z $(mysqldo "select hostname from cfg_network where serial=${serial};") ]]   hostname=$(mysqldo "select hostname from cfg_network where serial=${serial};")
48     if [[ -z ${hostname} ]] || [[ ${hostname} = NULL ]]
49   then   then
50   # set hostname to MCORE_DEFAULT_HOSTNAME   # set hostname to MCORE_DEFAULT_HOSTNAME
51   decho "hostname='${MCORE_DEFAULT_HOSTNAME}'"   decho "hostname='${MCORE_DEFAULT_HOSTNAME}'"
52   import_resource cfg_network "${serial}" hostname "${MCORE_DEFAULT_HOSTNAME}"   import_resource cfg_network "${serial}" hostname "${MCORE_DEFAULT_HOSTNAME}"
53   fi   fi
54   if [[ -z $(mysqldo "select domain from cfg_network where serial=${serial};") ]]   domain=$(mysqldo "select domain from cfg_network where serial=${serial};")
55     if [[ -z ${domain} ]] || [[ ${domain} = NULL ]]
56   then   then
57   # set domain to MCORE_DEFAULT_DOMAIN   # set domain to MCORE_DEFAULT_DOMAIN
58   decho "hostname='${MCORE_DEFAULT_DOMAIN}'"   decho "hostname='${MCORE_DEFAULT_DOMAIN}'"
# Line 67  set_hardware_detect() Line 83  set_hardware_detect()
83   else   else
84   decho "no monitor_resolution found"   decho "no monitor_resolution found"
85   fi   fi
86    
87     # update the hwdetected flags
88     import_resource client_serial "${serial}" hwdetected 1
89  }  }

Legend:
Removed from v.2493  
changed lines
  Added in v.2497