X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=prosodyctl;h=522ebde9a3e62e73c006f6eb52ed9ac6a92f92d9;hb=fb7218ac7eb9e7903846bac9c90760de448f79ad;hp=358ec9eaacda242120512d5ad3471fefa5e76c8c;hpb=ee459ed691c0aaea58bdbad943c886d495d04eae;p=prosody.git diff --git a/prosodyctl b/prosodyctl index 358ec9ea..522ebde9 100755 --- a/prosodyctl +++ b/prosodyctl @@ -32,7 +32,6 @@ end -- Required to be able to find packages installed with luarocks pcall(require, "luarocks.require") - config = require "core.configmanager" do @@ -102,15 +101,20 @@ local error_messages = setmetatable({ ["no-password"] = "No password was supplied"; ["no-such-user"] = "The given user does not exist on the server"; ["unable-to-save-data"] = "Unable to store, perhaps you don't have permission?"; - ["no-pidfile"] = "There is no pidfile option in the configuration file, see http://prosody.im/doc/prosodyctl#pidfile for help"; + ["no-pidfile"] = "There is no 'pidfile' option in the configuration file, see http://prosody.im/doc/prosodyctl#pidfile for help"; ["no-such-method"] = "This module has no commands"; ["not-running"] = "Prosody is not running"; }, { __index = function (t,k) return "Error: "..(tostring(k):gsub("%-", " "):gsub("^.", string.upper)); end }); +local events = require "util.events".new(); + hosts = {}; +prosody = { hosts = hosts, events = events }; -require "core.hostmanager" -require "core.eventmanager".fire_event("server-starting"); +for hostname, config in pairs(config.getconfig()) do + hosts[hostname] = { events = events }; +end + require "core.modulemanager" require "util.prosodyctl"