2017-09-07 22:09:48 +10:00
|
|
|
_G.DEFAC = 1
|
2017-10-07 07:16:22 +11:00
|
|
|
do
|
2017-09-04 02:10:03 +10:00
|
|
|
if component.list("gpu")() and component.list("screen")() and component.list("keyboard")() and tty and kbd then
|
2017-10-07 07:16:22 +11:00
|
|
|
local ts = {}
|
|
|
|
if fs.exists("/boot/sys/session.dat") then
|
|
|
|
local f = io.open("/boot/sys/session.dat","rb")
|
|
|
|
if f then
|
|
|
|
S = f:read("*a")
|
|
|
|
f:close()
|
|
|
|
log(S)
|
|
|
|
for line in S:gmatch("[^\n]+") do
|
|
|
|
log(line)
|
|
|
|
local ga, sa, ka = line:match("(.+)\t(.+)\t(.+)")
|
|
|
|
ts[#ts+1] = {os.gensalt(16),ga,sa,ka}
|
|
|
|
log()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
ts[1] = {os.gensalt(16),component.list("gpu")(),component.list("screen")(),component.list("keyboard")()} -- session name, GPU address, screen address, keyboard address
|
|
|
|
end
|
|
|
|
for k,v in ipairs(ts) do
|
|
|
|
log(v[1],v[2],v[3],v[4])
|
|
|
|
tty(v[2],v[3],v[1])
|
|
|
|
kbd(v[4],v[1])
|
2017-10-08 01:35:51 +11:00
|
|
|
loginmanager(v[1])
|
2017-10-07 07:16:22 +11:00
|
|
|
end
|
2017-09-04 02:10:03 +10:00
|
|
|
elseif nshd then
|
|
|
|
nshd(23)
|
2017-08-04 17:46:11 +10:00
|
|
|
end
|
2017-10-07 07:16:22 +11:00
|
|
|
end
|
2017-07-31 09:26:58 +10:00
|
|
|
computer.beep()
|