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 2456 by niro, Thu Sep 3 13:47:44 2015 UTC revision 2457 by niro, Thu Sep 3 14:42:38 2015 UTC
# Line 6  validate_client() Line 6  validate_client()
6   local ip_address="$2"   local ip_address="$2"
7   local serial   local serial
8   local mtime   local mtime
9     local serial_id
10    
11   if [[ -z ${mac_address} ]]   if [[ -z ${mac_address} ]]
12   then   then
# Line 44  validate_client() Line 45  validate_client()
45   SSLSAY_PORT="6666"   SSLSAY_PORT="6666"
46   nsslsay_fingerprint "register '${serial}'"   nsslsay_fingerprint "register '${serial}'"
47    
48     # register the client as online
49     serial_id=$(mysqldo "select serial from state_connected where serial=${serial};")
50     if [[ -n ${serial_id} ]]
51     then
52     mysqldo "update state_connected set ip='${ip_address}', mac='${mac_address}', mtime='${mtime}' where serial=${serial};"
53     else
54     mysqldo "insert into state_connected(serial,ip,mac,mtime) values('${serial}','${ip_address}','${mac_address}','${mtime}');"
55     fi
56    
57   return 0   return 0
58   fi   fi
59  }  }

Legend:
Removed from v.2456  
changed lines
  Added in v.2457