Index: univention-ldap/univention-backup2master =================================================================== --- univention-ldap/univention-backup2master (Revision 46039) +++ univention-ldap/univention-backup2master (Arbeitskopie) @@ -468,9 +468,12 @@ # Move Samba4 FSMO roles to this host # https://forge.univention.org/bugzilla/show_bug.cgi?id=26986 if [ -x /usr/bin/samba-tool ]; then - if samba-tool fsmo show | grep -qi "CN=${old_ldap_master_hostname},CN=Servers,CN=[^,]*,CN=Sites,CN=Configuration"; then - samba-tool fsmo seize --role=all --force - fi + samba_tool_fsmo_output=$(samba-tool fsmo show) + while read -a rolename; do + if echo "$samba_tool_fsmo_output" | grep "${rolename[0]}" | grep -qi "CN=${old_ldap_master_hostname},CN=Servers,CN=[^,]*,CN=Sites,CN=Configuration"; then + samba-tool fsmo seize --role="${rolename[1]}" + fi + done <<<"$(printf 'InfrastructureMasterRole infrastructure\nRidAllocationMasterRole rid\nPdcEmulationMasterRole pdc\nDomainNamingMasterRole naming\nSchemaMasterRole schema')" fi samdb_remove_dc_account "$old_ldap_master_hostname"