--- mcore-src/trunk/mcore-tools/src/include/register.global.class.in 2015/09/03 13:01:47 2441 +++ mcore-src/trunk/mcore-tools/src/include/register.global.class.in 2015/09/03 13:28:24 2442 @@ -3,8 +3,10 @@ validate_client() { local mac_address="$1" + local ip_address="$2" local serial local mtime + local cmd if [[ -z ${mac_address} ]] then @@ -12,6 +14,12 @@ return 1 fi + if [[ -z ${ip_address} ]] + then + eecho "Error: No ip_address given" + return 1 + fi + decho "registering mac_address='${mac_address}'" # first check if mac is registered @@ -31,6 +39,13 @@ else decho "serial='${serial}'" rvecho "${serial}" + + cmd+="quiet" + cmd+="register '${serial}'" + SSLSAY_IP="${IP}" + SSLSAY_PORT="6666" + nsslsay_fingerprint "${cmd}" + return 0 fi } @@ -41,6 +56,7 @@ local iface_ip local iface local mac_address + local cmd control_server_ip=$(dns_to_ip ${MCORE_CONTROL_SERVER}) iface_ip=$(iface_for_remote_addr ${control_server_ip}) @@ -53,5 +69,23 @@ decho "mac_address='${mac_address}'" decho "register '${mac_address}'" - nsslsay_fingerprint "register '${mac_address}'" + + cmd+="quiet" + cmd+="register '${mac_address}' '${iface_ip}'" + nsslsay_fingerprint "${cmd}" +} + +register_client_local() +{ + local serial="$1" + + if [[ -z ${serial} ]] + then + eecho "No serial given" + return 1 + fi + + CONFIG="${MCORE_CONFIG_PATH}/serial" + clearconfig + addconfig "CLIENT_SERIAL=\"${serial}\"" }