diff options
Diffstat (limited to 'plugins/mod_console.lua')
-rw-r--r-- | plugins/mod_console.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua index 3248ca8c..28e12a62 100644 --- a/plugins/mod_console.lua +++ b/plugins/mod_console.lua @@ -160,7 +160,8 @@ end -- Anything in def_env will be accessible within the session as a global variable def_env.server = {}; -function def_env.server:reload() + +function def_env.server:insane_reload() prosody.unlock_globals(); dofile "prosody" prosody = _G.prosody; @@ -185,6 +186,11 @@ function def_env.server:uptime() minutes, (minutes ~= 1 and "s") or "", os.date("%c", prosody.start_time)); end +function def_env.server:shutdown(reason) + prosody.shutdown(reason); + return true, "Shutdown initiated"; +end + def_env.module = {}; local function get_hosts_set(hosts, module) @@ -288,6 +294,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 |