Software /
code /
prosody
Changeset
1558:e15917530285
mod_console: Add config:reload() command
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 18 Jul 2009 15:34:36 +0100 |
parents | 1557:64837ed2d112 |
children | 1559:831649bb1922 |
files | plugins/mod_console.lua |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_console.lua Sat Jul 18 15:33:16 2009 +0100 +++ b/plugins/mod_console.lua Sat Jul 18 15:34:36 2009 +0100 @@ -160,6 +160,7 @@ -- Anything in def_env will be accessible within the session as a global variable def_env.server = {}; + function def_env.server:insane_reload() prosody.unlock_globals(); dofile "prosody" @@ -288,6 +289,11 @@ return true, tostring(config_get(host, section, key)); end +function def_env.config:reload() + local ok, err = prosody.reload_config(); + return ok, (ok and "Config reloaded (you may need to reload modules to take effect)") or tostring(err); +end + def_env.hosts = {}; function def_env.hosts:list() for host, host_session in pairs(hosts) do