2017-09-07 13:12:10 +10:00
|
|
|
function login()
|
2017-09-09 21:26:29 +10:00
|
|
|
local un,pw,cc = "","",false
|
2017-09-14 16:21:32 +10:00
|
|
|
print(MOTD)
|
2017-09-14 15:12:00 +10:00
|
|
|
if #os.users() > 0 then
|
2017-09-09 21:26:29 +10:00
|
|
|
repeat
|
2017-09-14 16:21:32 +10:00
|
|
|
io.write(net.id.." login: ")
|
2017-10-08 00:30:26 +11:00
|
|
|
un = io.read()
|
2017-09-09 21:26:29 +10:00
|
|
|
io.write("Password: ")
|
2017-10-08 00:30:26 +11:00
|
|
|
pw = io.read("*")
|
|
|
|
cc = os.su(un,pw)
|
2017-09-09 21:26:29 +10:00
|
|
|
until cc
|
|
|
|
return true
|
2017-09-07 13:12:10 +10:00
|
|
|
end
|
|
|
|
end
|
2017-10-08 01:35:51 +11:00
|
|
|
function loginmanager(sI)
|
|
|
|
spawn("login manager: "..sI or os.getenv("sI"), function()
|
|
|
|
if sI then os.setenv("sI",sI) end
|
|
|
|
while true do
|
|
|
|
login()
|
|
|
|
local _,nshell = pcall(loadfile,os.getuattr(os.getuid(),"shell"))
|
|
|
|
if type(nshell) ~= "function" then nshell = shell end
|
|
|
|
pcall(nshell,sI)
|
|
|
|
print(" ")
|
|
|
|
end
|
|
|
|
end) end
|