aboutsummaryrefslogtreecommitdiffstats
path: root/prosody
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-11-29 03:28:07 +0000
committerMatthew Wild <mwild1@gmail.com>2008-11-29 03:28:07 +0000
commitf03d1616f0b685bda23dfbe79d4d8cc7fd95fde5 (patch)
tree132e2f26bf8f64086adc5f75fc45a9921a1e5e4c /prosody
parente7cfd639687786d0426897f4706200818c66295a (diff)
parent7271c148cef981f9263a8794ebe27634423b07bd (diff)
downloadprosody-f03d1616f0b685bda23dfbe79d4d8cc7fd95fde5.tar.gz
prosody-f03d1616f0b685bda23dfbe79d4d8cc7fd95fde5.zip
Automated merge with http://waqas.ath.cx/
Diffstat (limited to 'prosody')
-rwxr-xr-xprosody23
1 files changed, 20 insertions, 3 deletions
diff --git a/prosody b/prosody
index 6f13decd..58ebc16a 100755
--- a/prosody
+++ b/prosody
@@ -2,15 +2,32 @@
-- Config here --
-
+CFG_SOURCEDIR=nil;
+CFG_CONFIGDIR=nil;
+CFG_PLUGINDIR=nil;
-- -- -- -- -- --
if CFG_SOURCEDIR then
+ if os.getenv("HOME") then
+ CFG_SOURCEDIR = CFG_SOURCEDIR:gsub("^~", os.getenv("HOME"));
+ end
package.path = CFG_SOURCEDIR.."/?.lua;"..package.path
- package.cpath = CFG_SOURCEDIR.."/?.lua;"..package.cpath
+ package.cpath = CFG_SOURCEDIR.."/?.so;"..package.cpath
end
+if CFG_CONFIGDIR then
+ if os.getenv("HOME") then
+ CFG_CONFIGDIR = CFG_CONFIGDIR:gsub("^~", os.getenv("HOME"));
+ end
+end
+
+if CFG_PLUGINDIR then
+ if os.getenv("HOME") then
+ CFG_PLUGINDIR = CFG_PLUGINDIR:gsub("^~", os.getenv("HOME"));
+ end
+end
+
-- Required to be able to find packages installed with luarocks
pcall(require, "luarocks.require")
@@ -21,7 +38,7 @@ log = require "util.logger".init("general");
do
-- TODO: Check for other formats when we add support for them
-- Use lfs? Make a new conf/ dir?
- local ok, err = config.load("lxmppd.cfg.lua");
+ local ok, err = config.load((CFG_CONFIGDIR or ".").."/prosody.cfg.lua");
if not ok then
log("error", "Couldn't load config file: %s", err);
log("info", "Falling back to old config file format...")