18.11.2018, 22:40
Code:
data = io.readfile('/home/ftp/data.esf')
if data then
lines = data:split('\n')
for _, line in ipairs(lines) do
props = line:split('\t')
if #props >= 5 then
addr = props[1]:match('[0-9]+/[0-9]+/[0-9]+$')
if addr then
name = props[2]:trim()
id = buslib.encodega(addr)
db:update('objects', { name = name }, { id = id })
end
end
end
os.remove('/home/ftp/data.esf')
end