Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Define the API table
- local api = {}
- -- Function to halt the system
- function api.halt()
- -- Copy halt.lua to the startup file
- fs.copy("/disk/bootloader/halt.lua", "/startup")
- -- Reboot the computer
- os.reboot()
- end
- -- Function to run the recovery script
- function api.recovery()
- -- Run the Recovery.lua script
- shell.run("/disk/boot/Recovery.lua")
- end
- -- Function to repair the system
- function api.repair()
- -- Delete the startup and no-os files if they exist
- if fs.exists("/startup") then
- fs.delete("/startup")
- end
- if fs.exists("/no-os") then
- fs.delete("/no-os")
- end
- -- Copy error script to startup and no-os script to bootloader
- fs.copy("/disk/boot/error", "/startup")
- fs.copy("/disk/bootloader/no-os", "/no-os")
- end
- -- Return the API table
- return api
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement