# HG changeset patch # User Matthew Wild # Date 1247927676 -3600 # Node ID e159175302859b16238c9c8bf602b5f860455855 # Parent 64837ed2d1127b0920795965ef6a3af892e3b3ac mod_console: Add config:reload() command diff -r 64837ed2d112 -r e15917530285 plugins/mod_console.lua --- 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