@@ -, +, @@ Bug #42124 join: Search for IP and MAC too When creating a new computer object, search for the IP and MAC address too. This solves the case where the computer object is pre-created, but uses a different name than the computer currently uses. --- a/management/univention-join/univention-server-join +++ a/management/univention-join/univention-server-join @@ -211,7 +211,10 @@ create_entry () { local group="$5" log 0 "Join $desc" - old_dn="$(univention-directory-manager "$module" list --filter name="$NEWHOSTNAME" "${ADMINOPTIONS[@]}" | DN1)" + query="(name=$NEWNAME)" + [ -n "${MAC:-}" ] && query+="(mac=$MAC)" + [ -n "${IP:-}" ] && query+="(ip=$IP)" + old_dn="$(univention-directory-manager computers/computer list --filter "(|${query})" "${ADMINOPTIONS[@]}" | DN1)" if [ $? -gt 0 ]; then log 1 "E: failed search $desc [$old_dn]" exit 1