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 2475 by niro, Mon Sep 7 08:48:22 2015 UTC revision 2476 by niro, Thu Sep 10 08:04:33 2015 UTC
# Line 26  validate_client() Line 26  validate_client()
26   # first check if mac is registered   # first check if mac is registered
27   serial=$(mysqldo "select serial from client_serials where mac='${mac_address}'")   serial=$(mysqldo "select serial from client_serials where mac='${mac_address}'")
28    
29     # current mtime
30     mtime=$(date +%s)
31    
32   if [[ -z ${serial} ]]   if [[ -z ${serial} ]]
33   then   then
  mtime=$(date +%s)  
   
34   # 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)
35   serial=$(mysqldo "insert into client_serials (mtime, mac) values('${mtime}','${mac_address}'); select last_insert_id();")   serial=$(mysqldo "insert into client_serials (mtime, mac) values('${mtime}','${mac_address}'); select last_insert_id();")
36   fi   fi

Legend:
Removed from v.2475  
changed lines
  Added in v.2476