#!/bin/bash
set -euo pipefail

# --- Defaults ---
LOG_DIR="./logs"
mkdir -p "$LOG_DIR"
UDM_HOST="100.100.10.1"
UDM_SSH_USER="root"
LEASE_FILE="/mnt/.rwfs/data/data/udapi-config/dnsmasq.lease"
SUBNET="192.168.10.0/24"
RESERVATION_FILE="reserved_ips.conf"

# --- Technitium API credentials ---
TECHNITIUM_API_CONF="/root/.technitium_api"
if [[ ! -f "$TECHNITIUM_API_CONF" ]]; then
  echo "❌ Missing Technitium credentials file: $TECHNITIUM_API_CONF" >&2
  exit 1
fi
TECHNITIUM_API_HOST="$(grep -E '^API_HOST=' "$TECHNITIUM_API_CONF" | cut -d'=' -f2-)"
TECHNITIUM_API_KEY="$(grep -E '^API_KEY=' "$TECHNITIUM_API_CONF" | cut -d'=' -f2-)"
DNS_ZONE="inxs.be"