Skip to content

Commit

Permalink
Issue #30: fix ucs-sso update
Browse files Browse the repository at this point in the history
univention/ucsschool-components/ui-common#30
  • Loading branch information
fbotner committed Dec 15, 2022
1 parent f6f9b96 commit 413c02d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/utils/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ create_version_file_tmp_ucsver () {
basic_setup_ucs_joined () {
local masterip="${1:?missing master ip}"
local admin_password="${2:-univention}"
local rv=0 server_role ldap_base domain
local rv=0 server_role ldap_base domain old_ip

server_role="$(ucr get server/role)"
ldap_base="$(ucr get ldap/base)"
Expand All @@ -1253,14 +1253,19 @@ basic_setup_ucs_joined () {
service nscd restart || rv=1
fi

# get old ip TODO how to do it correctly?
old_ip="$(grep "set interfaces/eth0/address=" /var/log/univention/config-registry.replog | tail -1 | awk -F 'old:' '{print $2}')"
if [ -z "$old_ip" ]; then
old_ip="$(zgrep "set interfaces/eth0/address=" /var/log/univention/config-registry.replog.1.gz | tail -1 | awk -F 'old:' '{print $2}')"
fi

# fix ucs-sso
if [ "$server_role" = "domaincontroller_master" ] || [ "$server_role" = "domaincontroller_backup" ]; then
my_old_ip="$(grep "set interfaces/eth0/address=" /var/log/univention/config-registry.replog | tail -1 | awk -F 'old:' '{print $2}')"
sso_fqdn="$(ucr get ucs/server/sso/fqdn)"
sso_hostname="${sso_fqdn%%.*}"
udm dns/host_record modify --binddn "$binddn" --bindpwd "$admin_password" \
test -n "$old_ip" && udm dns/host_record modify \
--dn "relativeDomainName=$sso_hostname,zoneName=$domain,cn=dns,$ldap_base" \
--remove a="$my_old_ip"
--remove a="$old_ip"
fi

# fix samba/dns settings on samba DC's
Expand Down

0 comments on commit 413c02d

Please sign in to comment.