-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinit.lua
More file actions
26 lines (24 loc) · 701 Bytes
/
init.lua
File metadata and controls
26 lines (24 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function LoadX()
s = {ssid="", pwd="", host="", domain="", path="", err="",update=0}
if (file.open("s.txt","r")) then
local sF = file.read()
--print("setting: "..sF)
file.close()
for k, v in string.gmatch(sF, "([%w.]+)=([%S ]+)") do
s[k] = v
print(k .. ": " .. v)
end
end
end
print(collectgarbage("count").." kB used")
LoadX()
if ((s.err == "") and s.host and s.domain and s.path) then
if (tonumber(s.update)>0) then
tmr.alarm (0, tonumber(s.update)*60000, 1, function()
print("checking for update")
end)
end
dofile("client.lua")
else
dofile("server.lua")
end