made the login setup saner.

This commit is contained in:
Izaya 2017-09-14 16:21:32 +10:00
parent 64d3958451
commit 61bf854539
2 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,6 @@ spawn("lua shell",function()
_ENV = shutil.genenv() _ENV = shutil.genenv()
coroutine.yield() coroutine.yield()
log(pcall(login)) log(pcall(login))
print("\f"..MOTD)
print(_VERSION) print(_VERSION)
while true do while true do
write((os.getenv("PWD") or "").."> ") write((os.getenv("PWD") or "").."> ")

View File

@ -1,8 +1,9 @@
function login() function login()
local un,pw,cc = "","",false local un,pw,cc = "","",false
print(MOTD)
if #os.users() > 0 then if #os.users() > 0 then
repeat repeat
io.write("\f"..MOTD.."\n"..net.id.." login: ") io.write(net.id.." login: ")
un = io.read() un = io.read()
io.write("Password: ") io.write("Password: ")
pw = io.read("*") pw = io.read("*")