Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main()
- print("Login System v1")
- print("Username: ")
- local username_entered = io.read()
- print("Password: ")
- local password_entered = io.read()
- if fs.exists("/usr/pwd/"..username_entered) then
- local pwdf = fs.open("/usr/pwd/"..username_entered, "r")
- pwdif = pwdf.readAll()
- if pwdif == password_entered then
- print("Password Correct!")
- else print("Password incorrect. Please enter again.")
- shell.run("/bin/boot/login.bin")
- end
- else print("This user doesn't exist!")
- main()
- end
- end
- local ok, err = pcall(main)
- if not ok then print("Error occured: "..err)
- print("Press any key to continue..")
- os.pullEvent("key")
- shell.run("/bin/boot/login.bin")
- end
- return
Add Comment
Please, Sign In to add comment