03.10.2018, 10:19
Enabled FTP server on LM, then upload data.esf to root directory (use ftp account). Then run this script once. ESF file will be deleted once this script runs.
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