Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local clientID = "7aEnmrvX"
- local serverID = "WL0P040B"
- local rpcID = "AJEnqBtA"
- local startup = [[
- for i,v in ipairs(rs.getSides()) do
- if peripheral.getType(v) == "modem" then
- rednet.open(v)
- end
- end
- os.loadAPI("rpc")
- term.clear()
- term.setCursorPos(1,1)
- if fs.exists("startup2") then
- parallel.waitForAll(function() shell.run("startup2") end, rpc.run)
- else
- parallel.waitForAll(function() shell.run("shell") end, rpc.run)
- end
- ]]
- if not fs.exists("rpc") then
- local webHandle = http.get("http://pastebin.com/raw.php?i="..rpcID)
- local data = webHandle.readAll()
- webHandle.close()
- local fileHandle = fs.open("rpc", "w")
- fileHandle.write(data)
- fileHandle.close()
- end
- local selection = 0
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("RPC - Based SSH Installer")
- print("Please make a selection:")
- print("1 - Client")
- print("2 - Server")
- write("> ")
- selection = tonumber(read())
- if selection then
- if selection == 1 or selection == 2 then
- break
- end
- end
- end
- if selection == 1 then
- local webHandle = http.get("http://pastebin.com/raw.php?i="..clientID)
- local data = webHandle.readAll()
- webHandle.close()
- local fileHandle = fs.open("client", "w")
- fileHandle.write(data)
- fileHandle.close()
- elseif selection == 2 then
- local webHandle = http.get("http://pastebin.com/raw.php?i="..serverID)
- local data = webHandle.readAll()
- webHandle.close()
- local fileHandle = fs.open("server", "w")
- fileHandle.write(data)
- fileHandle.close()
- if fs.exists("startup") then
- fs.copy("startup", "startup2")
- end
- local fileHandle = fs.open("startup", "w")
- fileHandle.write(startup)
- fileHandle.close()
- end
- print("Finished.")
- os.sleep(2)
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement