Advertisement
DOGGYWOOF

Untitled

Oct 6th, 2024 (edited)
7
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. -- Define paths
  2. local startupPath = "/disk/boot/startup"
  3. local newStartupPath = "/disk/boot/error"
  4. local rebootCommand = "/disk/ACPI/soft-reboot-load"
  5.  
  6. -- Function to replace the startup file
  7. local function replaceStartup()
  8. -- Open the startup file for writing
  9. local file = fs.open(startupPath, "w")
  10. if file then
  11. -- Write the new startup path to the file
  12. file.writeLine("shell.run('" .. newStartupPath .. "')")
  13. file.close()
  14. else
  15. print("Error: Could not open the startup file for writing.")
  16. end
  17. end
  18.  
  19. -- Function to run the reboot command
  20. local function reboot()
  21. shell.run(rebootCommand)
  22. end
  23.  
  24. -- Execute the functions
  25. replaceStartup()
  26. reboot()
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement