#!/usr/bin/env bash

if [[ $EUID -ne 0 ]]; then
	echo -e "\033[91m limine-reset-enroll must be run with root privileges.\033[0m" >&2
	exit 1
fi

# Import functions and environment variables
readonly LIMINE_FUNCTIONS_PATH=/usr/lib/limine/limine-common-functions

if [[ -f "${LIMINE_FUNCTIONS_PATH}" ]]; then
	# shellcheck disable=SC1090
	source "${LIMINE_FUNCTIONS_PATH}" || {
		echo -e "ERROR: Failed to source '${LIMINE_FUNCTIONS_PATH}'." >&2
		exit 1
	}
	initialize_header || exit 1
	reset_enroll_config
fi
