Software /
code /
prosody
Diff
plugins/mod_console.lua @ 712:56410c0cd846
mod_console: Added module:reload
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 13 Jan 2009 22:39:07 +0500 |
parent | 669:9255abbb3068 |
child | 736:7cbae2d16fd6 |
line wrap: on
line diff
--- a/plugins/mod_console.lua Tue Jan 13 22:38:20 2009 +0500 +++ b/plugins/mod_console.lua Tue Jan 13 22:39:07 2009 +0500 @@ -160,15 +160,24 @@ 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 - +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 + +function def_env.module:reload(name, host) + local mm = require "modulemanager"; + local ok, err = mm.reload(host or self.env.host, name); + if not ok then + return false, err or "Unknown error reloading module"; + end + return true, "Module reloaded"; +end + def_env.config = {}; function def_env.config:load(filename, format) local config_load = require "core.configmanager".load;