From f588a0f5b0dd4c6b6d2c81a517594b50b45fc15b Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 27 Nov 2008 23:36:17 +0000 Subject: Add module:unload() to mod_console, and allow module:load() to take config param --- plugins/mod_console.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua index 8b123df4..b1dc263c 100644 --- a/plugins/mod_console.lua +++ b/plugins/mod_console.lua @@ -129,15 +129,24 @@ function def_env.server:reload() end def_env.module = {}; -function def_env.module:load(name, host) +function def_env.module:load(name, host, config) local mm = require "modulemanager"; - local ok, err = mm.load(host or self.env.host, name); + local ok, err = mm.load(host or self.env.host, name, config); if not ok then return false, err or "Unknown error loading module"; end return true, "Module loaded"; end +function def_env.module:unload(name, host) + local mm = require "modulemanager"; + local ok, err = mm.unload(host or self.env.host, name); + if not ok then + return false, err or "Unknown error unloading module"; + end + return true, "Module unloaded"; +end + def_env.config = {}; function def_env.config:load(filename, format) local config_load = require "core.configmanager".load; -- cgit v1.2.3