aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-07-18 15:34:36 +0100
committerMatthew Wild <mwild1@gmail.com>2009-07-18 15:34:36 +0100
commit857dd641dc2be7fd14cb8a34d22890d6ff312012 (patch)
treeab99e972171134eb01c7bb07e867fbecb6bc4c13
parentfd0dc078bf261161476a2a14afae696552fe3e46 (diff)
downloadprosody-857dd641dc2be7fd14cb8a34d22890d6ff312012.tar.gz
prosody-857dd641dc2be7fd14cb8a34d22890d6ff312012.zip
mod_console: Add config:reload() command
-rw-r--r--plugins/mod_console.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua
index 2246dbff..d505a2e2 100644
--- a/plugins/mod_console.lua
+++ b/plugins/mod_console.lua
@@ -160,6 +160,7 @@ end
-- 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 @@ function def_env.config:get(host, section, key)
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