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 2430 by niro, Thu Sep 3 12:10:16 2015 UTC revision 2435 by niro, Thu Sep 3 12:35:41 2015 UTC
# Line 1  Line 1 
1    # $Id$
2    
3  validate_client()  validate_client()
4  {  {
5   local mac_address="$1"   local mac_address="$1"
6   local serial   local serial
7     local mtime
8    
9   if [[ -z ${mac_address} ]]   if [[ -z ${mac_address} ]]
10   then   then
# Line 15  validate_client() Line 17  validate_client()
17    
18   if [[ -z ${serial} ]]   if [[ -z ${serial} ]]
19   then   then
20     mtime=$(date +%s)
21    
22   # request a new serial; one command now (cause must be done in the same session)   # request a new serial; one command now (cause must be done in the same session)
23   serial=$(mysqldo "insert into client_serials (mtime, mac) values('${CUR_MTIME}','${CUR_MAC}'); select last_insert_id();")   serial=$(mysqldo "insert into client_serials (mtime, mac) values('${mtime}','${mac_address}'); select last_insert_id();")
24   fi   fi
25    
26   echo "serial='${serial}'"   if [[ -z ${serial} ]]
27     then
28     return 1
29     else
30     echo "serial='${serial}'"
31     return 0
32     fi
33  }  }
34    
35  register_client()  register_client()
# Line 40  register_client() Line 50  register_client()
50   echo "DEBUG: mac_address='${mac_address}'"   echo "DEBUG: mac_address='${mac_address}'"
51    
52   echo "register '${mac_address}'"   echo "register '${mac_address}'"
53     nsslsay_fingerprint "register '${mac_address}'"
54  }  }

Legend:
Removed from v.2430  
changed lines
  Added in v.2435