Update the lua scripts to use the new mkdir function.

This commit is contained in:
Mark Crane
2013-04-12 18:46:02 +00:00
parent d747bc4542
commit 90711f34bc
8 changed files with 15 additions and 14 deletions

View File

@@ -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"));