#!/bin/bash
#
# Univention S4 Connector
#
# SPDX-FileCopyrightText: 2013-2025 Univention GmbH
# SPDX-License-Identifier: AGPL-3.0-only

. /usr/lib/univention-server/lib/server_password_change/debug.sh
. /usr/share/univention-lib/base.sh

if [ "$1" = "postchange" ]; then
	eval "$(ucr shell ldap/hostdn connector/ldap/binddn)"

	if [ -n "$connector_ldap_binddn" -a "$connector_ldap_binddn" = "$ldap_hostdn" ]; then
		echowithtimestamp "restart univention-s4-connector after server password change"
		test -x /etc/init.d/univention-s4-connector && invoke-rc.d univention-s4-connector restart
	fi
fi

