#!/usr/bin/python3
#
# Remove status file of Univention System Setup
# Stop firefox browser if frontend uses legacy code
#
# SPDX-FileCopyrightText: 2016-2025 Univention GmbH
# SPDX-License-Identifier: AGPL-3.0-only

import os
import os.path

import univention.config_registry


PATH_BROWSER_PID = '/var/cache/univention-system-setup/browser.pid'


def finish_system_setup_boot():
    ucr = univention.config_registry.ConfigRegistry()
    ucr.load()

    # make sure that the status file is removed
    # (see also 05_remove_setup_status_file)
    setup_status_file = '/var/www/ucs_setup_process_status.json'
    if os.path.exists(setup_status_file):
        os.remove(setup_status_file)


if __name__ == "__main__":
    finish_system_setup_boot()
