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 2431 by niro, Thu Sep 3 12:15:13 2015 UTC
# Line 3  validate_client() Line 3  validate_client()
3  {  {
4   local mac_address="$1"   local mac_address="$1"
5   local serial   local serial
6     local mtime
7    
8   if [[ -z ${mac_address} ]]   if [[ -z ${mac_address} ]]
9   then   then
# Line 15  validate_client() Line 16  validate_client()
16    
17   if [[ -z ${serial} ]]   if [[ -z ${serial} ]]
18   then   then
19     mtime=$(date +%s)
20    
21   # 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)
22   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();")
23   fi   fi
24    
25   echo "serial='${serial}'"   echo "serial='${serial}'"

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