+-- Prosody IM
+-- Copyright (C) 2008-2009 Matthew Wild
+-- Copyright (C) 2008-2009 Waqas Hussain
+--
+-- This project is MIT/X11 licensed. Please see the
+-- COPYING file in the source package for more information.
+--
+
local config = require "core.configmanager";
local encodings = require "util.encodings";
local io, os = io, os;
local tostring, tonumber = tostring, tonumber;
+
+local CFG_SOURCEDIR = _G.CFG_SOURCEDIR;
+
module "prosodyctl"
function adduser(params)
local file, err = io.open(pidfile);
if not file then
- return false, "pidfile-read-failed", ret;
+ return false, "pidfile-read-failed", err;
end
local pid = tonumber(file:read("*a"));
end
if not CFG_SOURCEDIR then
os.execute("./prosody");
- elseif CFG_SOURCEDIR:match("^/usr/local") then
- os.execute("/usr/local/bin/prosody");
else
- os.execute("prosody");
+ os.execute(CFG_SOURCEDIR.."/../../bin/prosody");
end
return true;
end