mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-02-06 07:59:23 +00:00
Revert "Revert "Change. Use require "resources.functions.config" to load co…"
This commit is contained in:
@@ -1,12 +1,26 @@
|
||||
|
||||
-- add file_exists function
|
||||
require "resources.functions.file_exists";
|
||||
|
||||
--find and return path to the config.lua
|
||||
function config()
|
||||
dofile(scripts_dir.."/resources/functions/file_exists.lua");
|
||||
if (file_exists("/etc/fusionpbx/config.lua")) then
|
||||
return "/etc/fusionpbx/config.lua";
|
||||
elseif (file_exists("/usr/local/etc/fusionpbx/config.lua")) then
|
||||
return "/usr/local/etc/fusionpbx/config.lua";
|
||||
else
|
||||
return scripts_dir.."/resources/config.lua";
|
||||
return "resources.config";
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- load config
|
||||
function load_config()
|
||||
local cfg = config()
|
||||
if cfg:sub(1,1) == '//' then
|
||||
dofile(cfg)
|
||||
else
|
||||
require(cfg)
|
||||
end
|
||||
end
|
||||
|
||||
load_config()
|
||||
|
||||
Reference in New Issue
Block a user