diff options
author | Kim Alvefur <zash@zash.se> | 2013-01-09 22:01:52 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2013-01-09 22:01:52 +0100 |
commit | 79a96e236c927803a943e2d38a2bb7ac7410d065 (patch) | |
tree | 78b78b36a878d1348f2386435302070abaa91127 | |
parent | c445bb3bd8907492a74c97872da15a8ac800b685 (diff) | |
download | prosody-79a96e236c927803a943e2d38a2bb7ac7410d065.tar.gz prosody-79a96e236c927803a943e2d38a2bb7ac7410d065.zip |
prosodyctl, prosody: Pass the selected config file from prosodyctl to prosody
-rwxr-xr-x | prosody | 2 | ||||
-rwxr-xr-x | prosodyctl | 3 |
2 files changed, 5 insertions, 0 deletions
@@ -70,6 +70,8 @@ function read_config() if CFG_CONFIGDIR then table.insert(filenames, CFG_CONFIGDIR.."/"..arg[2]); end + elseif os.getenv("PROSODY_CONFIG") then -- Passed by prosodyctl + table.insert(filenames, os.getenv("PROSODY_CONFIG")); else for _, format in ipairs(config.parsers()) do table.insert(filenames, (CFG_CONFIGDIR or ".").."/prosody.cfg."..format); @@ -61,6 +61,7 @@ end config = require "core.configmanager" +local ENV_CONFIG; do local filenames = {}; @@ -81,6 +82,7 @@ do local file = io.open(filename); if file then file:close(); + ENV_CONFIG = filename; CFG_CONFIGDIR = filename:match("^(.*)[\\/][^\\/]*$"); break; end @@ -162,6 +164,7 @@ if ok and pposix then -- Set our umask to protect data files pposix.umask(config.get("*", "core", "umask") or "027"); pposix.setenv("HOME", data_path); + pposix.setenv("PROSODY_CONFIG", ENV_CONFIG); else print("Error: Unable to load pposix module. Check that Prosody is installed correctly.") print("For more help send the below error to us through http://prosody.im/discuss"); |