DOGGYWOOF

Untitled

May 17th, 2024
3
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. -- Define the API table
  2. local api = {}
  3.  
  4. -- Function to halt the system
  5. function api.halt()
  6. -- Copy halt.lua to the startup file
  7. fs.copy("/disk/bootloader/halt.lua", "/startup")
  8. -- Reboot the computer
  9. os.reboot()
  10. end
  11.  
  12. -- Function to run the recovery script
  13. function api.recovery()
  14. -- Run the Recovery.lua script
  15. shell.run("/disk/boot/Recovery.lua")
  16. end
  17.  
  18. -- Function to repair the system
  19. function api.repair()
  20. -- Delete the startup and no-os files if they exist
  21. if fs.exists("/startup") then
  22. fs.delete("/startup")
  23. end
  24. if fs.exists("/no-os") then
  25. fs.delete("/no-os")
  26. end
  27. -- Copy error script to startup and no-os script to bootloader
  28. fs.copy("/disk/boot/error", "/startup")
  29. fs.copy("/disk/bootloader/no-os", "/no-os")
  30. end
  31.  
  32. -- Return the API table
  33. return api
  34.  
Add Comment
Please, Sign In to add comment