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 2461 by niro, Mon Sep 7 08:48:22 2015 UTC revision 2497 by niro, Thu Sep 10 14:08:40 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
# Line 54  validate_client() Line 55  validate_client()
55   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) values('${serial}','${ip_address}','${mac_address}','${mtime}');"
56   fi   fi
57    
58     # run hardware detection
59     if is_provided hardware
60     then
61     set_hardware_detect "${serial}"
62     fi
63    
64   return 0   return 0
65   fi   fi
66  }  }

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