#!/usr/bin/env python
# -*- encoding: utf-8; py-indent-offset: 4 -*-

def bake_rspamd(opsys, conf, conf_dir, plugins_dir):
    if "interval" in conf:
        target_dir = plugins_dir + "/%d" % conf["interval"] # Interval for async execution
        if not os.path.exists(target_dir):
            os.makedirs(target_dir)
    else:
        target_dir = plugins_dir
    shutil.copy2(cmk.utils.paths.local_agents_dir + "/plugins/rspamd", target_dir + "/rspamd")

bakery_info["rspamd"] = {
    "bake_function" : bake_rspamd,
    "os"            : [ "linux" ],
}
