/* SPDX-License-Identifier: BSD-2-Clause-Patent
 *
 * SPDX-FileCopyrightText: 2024 the prplMesh contributors (see AUTHORS.md)
 *
 * This code is subject to the terms of the BSD+Patent license.
 * See LICENSE file for more details.
 */

#!/usr/bin/amxrt

%config {
    name = "controller";
    controller = {
        mod-dir = "$@@{prefix}$@@{plugin-dir}/prplmesh/modules",
        external-mod-dir = "$@@{prefix}$@@{plugin-dir}/modules"
    };
    silent = false;
    import-dbg = true;
    dm-eventing-enabled = true;
    storage-path = "/opt/prplmesh/share/$@@{name}";
    storage-type = "odl";
    odl = {
        dm-load = true,
        dm-save = true,
        dm-save-on-changed = true,
        dm-save-delay = 1000,
        dm-defaults = "defaults.d",
        directory = "$@@{storage-path}/odl"
    };
    cfg-dir = "/etc/amx";
    include-dirs = [
        ".",
        "$@@{cfg-dir}/prplmesh",
        "$@@{cfg-dir}/modules",
        "/opt/prplmesh/config/$@@{name}/odl"
    ];
    import-dirs = [
        ".",
        "$@@{prefix}$@@{plugin-dir}/prplmesh",
        "$@@{prefix}$@@{plugin-dir}/modules",
        "$@@{prefix}/usr/lib/amx/prplmesh",
        "$@@{prefix}/usr/lib/amx/modules"
    ];
    //main files
    definition_file = "controller.odl";

    //persistent storage
    //pcm_svc_config = {
    //    "Objects" = "@CONTROLLER_ROOT_DM@"
    //};
}
include "$@@{definition_file}";
//include "mod_pcm_svc.odl";
import "mod-dmext.so";
