Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function savePIN(pin)
- local file = fs.open("/disk/security/PIN.config", "w")
- file.write(pin)
- file.close()
- end
- local function confirmPIN(pin)
- term.clear()
- term.setCursorPos(1,1)
- print("Confirm PIN:")
- local confirm = read("*")
- return pin == confirm
- end
- local function startDevice()
- term.clear()
- term.setCursorPos(1,1)
- print("Starting Device...")
- os.sleep(5)
- shell.run("/disk/os/lock.lua")
- end
- -- Main program
- term.clear()
- term.setCursorPos(1,1)
- print("Enter new PIN:")
- local newPIN = read("*")
- if confirmPIN(newPIN) then
- savePIN(newPIN)
- startDevice()
- else
- print("PINs do not match. Aborting.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement