#!/usr/bin/env bash

set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

if [[ "${EUID}" -ne 0 ]]; then
    exec sudo bash "$0" "$@"
fi

# On bootc systems this unlocks /usr for live testing; it fails if already unlocked.
bootc usr-overlay || true

exec bash "${SCRIPT_DIR}/install.sh" "$@"
