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 2439 by niro, Thu Sep 3 12:54:15 2015 UTC revision 2447 by niro, Thu Sep 3 13:47:44 2015 UTC
# Line 3  Line 3 
3  validate_client()  validate_client()
4  {  {
5   local mac_address="$1"   local mac_address="$1"
6     local ip_address="$2"
7   local serial   local serial
8   local mtime   local mtime
9    
# Line 12  validate_client() Line 13  validate_client()
13   return 1   return 1
14   fi   fi
15    
16     if [[ -z ${ip_address} ]]
17     then
18     eecho "Error: No ip_address given"
19     return 1
20     fi
21    
22   decho "registering mac_address='${mac_address}'"   decho "registering mac_address='${mac_address}'"
23     decho "registering ip_address='${ip_address}'"
24    
25   # first check if mac is registered   # first check if mac is registered
26   serial=$(mysqldo "select serial from client_serials where mac='${mac_address}'")   serial=$(mysqldo "select serial from client_serials where mac='${mac_address}'")
# Line 29  validate_client() Line 37  validate_client()
37   then   then
38   return 1   return 1
39   else   else
40   echo "serial='${serial}'"   decho "serial='${serial}'"
41     rvecho "${serial}"
42    
43     SSLSAY_IP="${ip_address}"
44     SSLSAY_PORT="6666"
45     nsslsay_fingerprint "register '${serial}'"
46    
47   return 0   return 0
48   fi   fi
49  }  }
# Line 52  register_client() Line 66  register_client()
66   decho "mac_address='${mac_address}'"   decho "mac_address='${mac_address}'"
67    
68   decho "register '${mac_address}'"   decho "register '${mac_address}'"
69   nsslsay_fingerprint "register '${mac_address}'"   nsslsay_fingerprint "register '${mac_address}' '${iface_ip}'"
70    }
71    
72    register_client_local()
73    {
74     local serial="$1"
75    
76     if [[ -z ${serial} ]]
77     then
78     eecho "No serial given"
79     return 1
80     fi
81    
82     CONFIG="${MCORE_CONFIG_PATH}/serial"
83     clearconfig
84     addconfig "CLIENT_SERIAL=\"${serial}\""
85  }  }

Legend:
Removed from v.2439  
changed lines
  Added in v.2447