Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local oldPull = os.pullEvent
- os.pullEvent = os.pullEventRaw
- --this file is the Boot Loader Handler, and deals with the starting Directions of the OS, checks for updates, and ensures security
- UpdateManagerFile = nil
- DefiningFile = nil
- SecurityFile = nil
- Errors = "n"
- start()
- function start()
- if settings.get("SystemState") == "Locked" then
- shell.run(".LockedScreen")
- else
- print("Starting Step 1")
- Boot_1()
- end
- end
- function Boot_1()
- print("Grabbing Major File Paths")
- DefiningFile = settings.get("SystemDefiner")
- local h = fs.open(DefiningFile,"r")
- UpdateManagerFile = h.readLine(8)
- SecurityFile = h.readLine(12)
- h.close()
- print("Task Completed")
- print("Proceeding to next Step")
- Boot_2()
- end
- function Boot_2()
- print("Starting Step 2")
- print("Checking Account Information")
- AccountChecker()
- print("Proceeding to next Step")
- Boot_3()
- end
- function Boot_3()
- print("Starting Step 3")
- if Errors == " " then
- print("Proceeding to next Step")
- Boot_End()
- else
- print("ERRORS WERE DETECTED, SHOW THEM NOW")
- print(Errors)
- print("to be able to run your Device, all errors must be fixed")
- print("to fix them, bring your tablet to the nearest Gov Office")
- sleep(2)
- settings.set("SystemState","Locked")
- sleep(10)
- os.shutdown
- end
- end
- function Boot_End()
- print("Boot Process Complete! Starting UpdateManager to check for Any new Updates")
- shell.run(UpdateManagerFile)
- end
- function AccountChecker()
- Errors = ""
- if fs.exists(".BankDetails") == false then
- Errors = Errors.."Missing Bank Details,"
- end
- if fs.exists(".ClientData") == false then
- Errors = Errors.."Missing Client Data,"
- end
- if fs.exists(".AccountDetails") == false then
- Errors = Errors.."Missing Account,"
- end
- end
- os.pullEvent = oldPull
Add Comment
Please, Sign In to add comment