---------------------------------------------------------]]-- function doDelete(data) if data ~= nil then data2=string.gsub(data,".pdf",".mail") dPDF=os.remove(string.format("%s%s","/data/fax/bad/",data)) dMAIL=os.remove(string.format("%s%s","/data/fax/bad/",data2)) if dPDF==true and dMAIL==true then return 1 elseif dPDF==true and dMAIL==nil then return 2 elseif dPDF==nil and dMAIL== true then return 3 else return 0 end end end --[[---------------------------------------------------------- Resend file ----------------------------------------------------------]]-- function resend(data) -- execute Befehl fehlt noch if data ~= nil then file=string.sub(data,1,15) file=string.format("%s%s%s",'/sbin/omgfaxdeliver -q /data/fax/bad/',file,'.mail') local state = os.execute(file) if tonumber(state or "1")==0 then return true else return false end end end --[[---------------------------------------------------------- Check if a file is double marked and save the name of file ----------------------------------------------------------]]-- function sendAndDelete() for k,v in pairs(Send) do if Delete[k] ~= nil then table.insert(doubleChecked, k) else if resend(k) then table.insert(SendPrint, k) else table.insert(doubleChecked, k) end end end for k,v in pairs(Delete) do if Send[k] ~= nil then else success=doDelete(k) if success==1 then table.insert(DeletePrint, k) elseif success==2 then k=string.format("%s%s",k,' wM') table.insert(DeletePrint,k) k=string.sub(k,1,(string.len(k)-3)) elseif success==3 then k=string.format("%s%s",k,' wP') table.insert(DeletePrint,k) k=string.sub(k,1,(string.len(k)-3)) else table.insert(doubleChecked,k) end end end end function printTable(data) if data ~= nil then print('