#!/bin/sh

case "$(ucr get server/role)" in
domaincontroller_master|domaincontroller_backup) ;;
*)
	if [ $# -ge 2 ]
	then
		module="$1"
		action="$2"
		shift 2
		exec /usr/sbin/univention-directory-manager "$module" "$action" \
			--binddn "$(ucr get tests/domainadmin/account)" \
			--bindpwdfile "$(ucr get tests/domainadmin/pwdfile)" \
			"$@"
	fi
	;;
esac
exec /usr/sbin/univention-directory-manager "$@"
