diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-03-22 21:54:59 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-03-22 21:54:59 +0000 |
commit | b0d2e9a3dec88b7376dcbce49aa69d21a0b2087d (patch) | |
tree | 7e309739e6e09b1a7499dc467bf58376b3322cdd /util | |
parent | 7f6635523c5ab8417a5709ec717810bc26315059 (diff) | |
download | prosody-b0d2e9a3dec88b7376dcbce49aa69d21a0b2087d.tar.gz prosody-b0d2e9a3dec88b7376dcbce49aa69d21a0b2087d.zip |
prosodyctl, util.prosodyctl: Pass source path as a parameter instead of global variable
Diffstat (limited to 'util')
-rw-r--r-- | util/prosodyctl.lua | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua index 0da28cfa..eee09762 100644 --- a/util/prosodyctl.lua +++ b/util/prosodyctl.lua @@ -24,8 +24,6 @@ local io, os = io, os; local print = print; local tonumber = tonumber; -local CFG_SOURCEDIR = _G.CFG_SOURCEDIR; - local _G = _G; local prosody = prosody; @@ -231,7 +229,7 @@ local function isrunning() return true, signal.kill(pid, 0) == 0; end -local function start() +local function start(source_dir) local ok, ret = isrunning(); if not ok then return ok, ret; @@ -239,10 +237,10 @@ local function start() if ret then return false, "already-running"; end - if not CFG_SOURCEDIR then + if not source_dir then os.execute("./prosody"); else - os.execute(CFG_SOURCEDIR.."/../../bin/prosody"); + os.execute(source_dir.."/../../bin/prosody"); end return true; end |