#!/bin/bash
#
# Univention Maintenance Mode
#  start/stop service
#
# SPDX-FileCopyrightText: 2018-2025 Univention GmbH
# SPDX-License-Identifier: AGPL-3.0-only


. /usr/share/univention-lib/ucr.sh
if is_ucr_true updater/maintenance; then
	systemctl start univention-maintenance-mode.service
else
	systemctl stop univention-maintenance-mode.service
fi

# has to be done here because the updater/maintenance trigger executes first the script
# and then the file...
ucr commit /etc/apache2/sites-available/univention-proxy.conf /etc/apache2/sites-available/univention.conf
systemctl reload apache2.service

exit 0
