View | Details | Raw Unified | Return to bug 30836 | Differences between
and this patch

Collapse All | Expand All

(-)96univention-samba4.inst (-23 / +7 lines)
 Lines 317-351    Link Here 
317
			exit 1
317
			exit 1
318
		fi
318
		fi
319
	else
319
	else
320
		if samba-tool domain info "$domainname"; then
320
		s4connector_dc=$(get_available_s4connector_dc) || return $?
321
			samba-tool domain join "$domainname" "$samba4_role" "${samba_join_options[@]}"
321
		s4connector_dc_fqdn="$s4connector_dc.$domainname"
322
		if samba-tool domain info "$s4connector_dc_fqdn"; then
323
			samba-tool domain join "$domainname" "$samba4_role" --server "$s4connector_dc_fqdn" "${samba_join_options[@]}"
322
			if [ $? -eq 0 ]; then
324
			if [ $? -eq 0 ]; then
323
				success=true
325
				success=true
326
				univention-config-registry set windows/wins-server?"$s4connector_dc_fqdn"
327
				break
324
			else
328
			else
325
				echo "Failed to join the domain $domainname."
329
				echo "Failed to join the server $s4connector_dc_fqdn"
326
				exit 1
330
				exit 1
327
			fi
331
			fi
328
		fi
332
		fi
329
330
		if [ -z "$success" ]; then
331
			# try again with --server
332
			cn=($(ldapsearch -x -ZZ -LLL -D "$ldap_hostdn" -y /etc/machine.secret \
333
						"(&(univentionService=Samba 4)(objectClass=univentionDomainController))" cn \
334
										| ldapsearch-wrapper | sed -n 's/^cn: \(.*\)/\1/p' ))
335
			for name in "${cn[@]}"; do
336
				if samba-tool domain info "$name.$domainname"; then
337
					samba-tool domain join "$domainname" "$samba4_role" --server "$name.$domainname" "${samba_join_options[@]}"
338
					if [ $? -eq 0 ]; then
339
						success=true
340
						univention-config-registry set windows/wins-server?"$name.$domainname"
341
						break
342
					else
343
						echo "Failed to join the server $name.$domainname."
344
						exit 1
345
					fi
346
				fi
347
			done
348
		fi
349
	fi
333
	fi
350
334
351
335

Return to bug 30836