mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-03 10:23:50 +00:00
Update the lua scripts to use the new mkdir function.
This commit is contained in:
@@ -35,11 +35,15 @@
|
||||
scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1));
|
||||
dofile(scripts_dir.."/resources/config.lua");
|
||||
|
||||
--general functions
|
||||
dofile(scripts_dir.."/resources/functions/file_exists.lua");
|
||||
dofile(scripts_dir.."/resources/functions/mkdir.lua");
|
||||
|
||||
--connect to the database
|
||||
dbh = freeswitch.Dbh(database["system"]);
|
||||
|
||||
--make sure the scripts/run dir exists
|
||||
os.execute("mkdir -p " .. scripts_dir .. "/run");
|
||||
mkdir(scripts_dir .. "/run");
|
||||
|
||||
--define the run file
|
||||
run_file = scripts_dir .. "/run/call_flow_monitor.tmp";
|
||||
@@ -53,11 +57,6 @@
|
||||
h:close()
|
||||
return o
|
||||
end
|
||||
--check if a file exists
|
||||
function file_exists(name)
|
||||
local f=io.open(name,"r")
|
||||
if f~=nil then io.close(f) return true else return false end
|
||||
end
|
||||
|
||||
--used to stop the lua service
|
||||
local file = assert(io.open(run_file, "w"));
|
||||
|
||||
Reference in New Issue
Block a user