#!/bin/bash
#
# Univention Admin Diary
#   machine password hook script
#
# SPDX-FileCopyrightText: 2019-2025 Univention GmbH
# SPDX-License-Identifier: AGPL-3.0-only

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

if [ "$1" = "nochange" ]; then
	/usr/sbin/univention-admin-diary-entry-create --event SERVER_PASSWORD_CHANGED_FAILED --arg "hostname=$(ucr get hostname)"
elif [ "$1" = "postchange" ]; then
	/usr/sbin/univention-admin-diary-entry-create --event SERVER_PASSWORD_CHANGED --arg "hostname=$(ucr get hostname)"
fi
