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 2435 by niro, Thu Sep 3 12:35:41 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}'"
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}'")
27    
# Line 27  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 44  register_client() Line 60  register_client()
60   iface=$(iface_for_ip ${iface_ip})   iface=$(iface_for_ip ${iface_ip})
61   mac_address=$(mac_for_iface ${iface})   mac_address=$(mac_for_iface ${iface})
62    
63   echo "DEBUG: MCORE_CONTROL_SERVER='${MCORE_CONTROL_SERVER}'"   decho "MCORE_CONTROL_SERVER='${MCORE_CONTROL_SERVER}'"
64   echo "DEBUG: iface_ip='${iface_ip}'"   decho "iface_ip='${iface_ip}'"
65   echo "DEBUG: iface='${iface}'"   decho "iface='${iface}'"
66   echo "DEBUG: mac_address='${mac_address}'"   decho "mac_address='${mac_address}'"
67    
68     decho "register '${mac_address}'"
69     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   echo "register '${mac_address}'"   CONFIG="${MCORE_CONFIG_PATH}/serial"
83   nsslsay_fingerprint "register '${mac_address}'"   clearconfig
84     addconfig "CLIENT_SERIAL=\"${serial}\""
85  }  }

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