Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/include/register.global.class.in

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

revision 2497 by niro, Thu Sep 10 14:08:40 2015 UTC revision 2701 by niro, Wed Dec 16 14:42:45 2015 UTC
# Line 7  validate_client() Line 7  validate_client()
7   local serial   local serial
8   local mtime   local mtime
9   local serial_id   local serial_id
10     local os
11     local tools
12     local netboot
13    
14   if [[ -z ${mac_address} ]]   if [[ -z ${mac_address} ]]
15   then   then
# Line 46  validate_client() Line 49  validate_client()
49   SSLSAY_PORT="6666"   SSLSAY_PORT="6666"
50   nsslsay_fingerprint "register '${serial}'"   nsslsay_fingerprint "register '${serial}'"
51    
52     # get netboot state
53     nsslsay_queue_init
54     nsslsay_queue_add "nocolors"
55     nsslsay_queue_add "get version.netboot"
56     netboot=$(control_client "${serial}" run-queue)
57    
58   # register the client as online   # register the client as online
59   serial_id=$(mysqldo "select serial from state_connected where serial=${serial};")   serial_id=$(mysqldo "select serial from state_connected where serial=${serial};")
60   if [[ -n ${serial_id} ]]   if [[ -n ${serial_id} ]]
61   then   then
62   mysqldo "update state_connected set ip='${ip_address}', mac='${mac_address}', mtime='${mtime}' where serial=${serial};"   mysqldo "update state_connected set ip='${ip_address}', mac='${mac_address}', mtime='${mtime}', netboot='${netboot}' where serial=${serial};"
63   else   else
64   mysqldo "insert into state_connected(serial,ip,mac,mtime) values('${serial}','${ip_address}','${mac_address}','${mtime}');"   mysqldo "insert into state_connected(serial,ip,mac,mtime,netboot) values('${serial}','${ip_address}','${mac_address}','${mtime}', '${netboot}');"
65   fi   fi
66    
67     # update tools and os version info
68     nsslsay_queue_init
69     nsslsay_queue_add "nocolors"
70     nsslsay_queue_add "get version.os"
71     os=$(control_client "${serial}" run-queue)
72     import_resource client_version "${serial}" os "${os}"
73     nsslsay_queue_init
74     nsslsay_queue_add "nocolors"
75     nsslsay_queue_add "get version.tools"
76     tools=$(control_client "${serial}" run-queue)
77     import_resource client_version "${serial}" utils "${tools}"
78    
79   # run hardware detection   # run hardware detection
80   if is_provided hardware   if is_provided hardware
81   then   then
82   set_hardware_detect "${serial}"   run_hardware_detect "${serial}"
83   fi   fi
84    
85   return 0   return 0

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