Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function downloadUpdate(pasteURL)
- fs.delete("startup.bak")
- fs.copy("startup", "startup.bak")
- fs.delete("startup")
- shell.run("pastebin", "get", pasteURL, "startup")
- os.reboot()
- end
- local _command, _args
- local function receiveCommmand()
- local _, data = rednet.receive()
- data = textutils.unserialize(data)
- _command = data[1]
- table.remove(data[1], 1)
- _args = data
- end
- local function runCommand(command, args)
- if command == "update" then
- print("Updating!")
- downloadUpdate(args[1] or "ZSpt1WQH")
- end
- end
- local function run()
- end
- rednet.open("right")
- while true do
- parallel.waitForAny(run, receiveCommmand)
- if _command then
- runCommand(_command, _args)
- _command = nil
- _args = nil
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment