#!/bin/bash

# Reconcile the general LibrePortal config files ($configs_dir) against the
# freshly-cloned templates ($install_configs_dir). See reconcileConfigFile.
checkLibrePortalConfigFilesMissingVariables()
{
    local live fn rel remote
    while IFS= read -r live; do
        [[ -f "$live" ]] || continue
        fn=$(basename "$live")
        rel="${live#"$configs_dir"/}"
        remote="$install_configs_dir$fn"
        [[ -f "$remote" ]] || remote="$install_configs_dir$rel"
        reconcileConfigFile "$live" "$remote"
    done < <(find "$configs_dir" -type f ! -name ".category" ! -name "*.bak")

    isSuccessful "LibrePortal config reconciliation completed."
}
