mypal125

boot/celect

May 21st, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. -- Clear terminal - remove POST screen
  2. term.clear()
  3. term.setCursorPos(1, 1)
  4. -- Branding <3
  5. print("Celect Boot Manager")
  6. write("\"Celect\" a kernel: ")
  7. -- Celect kernel!
  8. local selection = read()
  9. -- Does the kernel exist?
  10. if fs.exists("/boot/kernel/"..selection) then
  11.   print("Booting to kernel "..selection.."...")
  12.   shell.run("/boot/kernel/"..selection, "celect")
  13. else
  14.   print("Kernel "..selection.." does not exist.")
  15. end
  16. -- Want to reboot?
  17. write("Do you wish to reboot? (Y|n) ")
  18. local selection = read()
  19. if selection == "n" or selection == "N" then
  20.   os.shutdown()
  21. else
  22.   os.reboot()
  23. end
  24. print("Oops! An error occurred, rebooting...")
  25. sleep(1)
  26. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment