X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=prosody;h=37a9d92b30b0424213ce3b418369ebaf99a0764f;hb=152d2ab697f7f76c942445abd66f2c515e5f187a;hp=6ff7743dff7411f3a8ef498ed38b278a25a365be;hpb=e97186e1a338eb9f399de3bf9add9412aa1565bc;p=prosody.git diff --git a/prosody b/prosody index 6ff7743d..37a9d92b 100755 --- a/prosody +++ b/prosody @@ -64,8 +64,6 @@ config = require "core.configmanager" -- functions get called function read_config() - -- TODO: Check for other formats when we add support for them - -- Use lfs? Make a new conf/ dir? local filenames = {}; local filename; @@ -75,7 +73,9 @@ function read_config() table.insert(filenames, CFG_CONFIGDIR.."/"..arg[2]); end else - table.insert(filenames, (CFG_CONFIGDIR or ".").."/prosody.cfg.lua"); + for _, format in ipairs(config.parsers()) do + table.insert(filenames, (CFG_CONFIGDIR or ".").."/prosody.cfg."..format); + end end for _,_filename in ipairs(filenames) do filename = _filename; @@ -202,14 +202,15 @@ function init_global_state() log("error", "core."..ports_option.." is not a table"); else for _, port in ipairs(ports) do + port = tonumber(port); if type(port) ~= "number" then log("error", "Non-numeric "..ports_option..": "..tostring(port)); else cl.start(listener, { ssl = conntype ~= "tcp" and global_ssl_ctx, port = port, - interface = config.get("*", "core", option.."_interface") - or cl.get(listener).default_interface + interface = (option and config.get("*", "core", option.."_interface")) + or cl.get(listener).default_interface or config.get("*", "core", "interface"), type = conntype });