Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not fs.isDir "Flare" then
- shell.run "pastebin run SD25GhYf"
- end
- local url = "https://raw.githubusercontent.com/Exerro/Phoenix/master/"
- local path = "Phoenix/"
- local files = {
- "init.lua";
- "apps/demo/config.lua";
- "apps/demo/init.lua";
- "apps/shell/config.lua";
- "apps/shell/init.lua";
- "bin/nethost.lua";
- "bin/OS.lua";
- "bin/rednethost.lua";
- "bin/start.lua";
- "lib/net/diffe-hellman.lua";
- "lib/net/network.lua";
- "lib/database.lua";
- "lib/debug.lua";
- "lib/encrypt.lua";
- "lib/filesystem.lua";
- "lib/process.lua";
- "lib/sha256.lua";
- "lib/user.lua";
- }
- for i = 1, #files do
- print( "Installing file " .. files[i] )
- local h = http.get( url .. files[i] )
- if h then
- local content = h.readAll()
- h.close()
- local h = fs.open( path .. files[i], "w" )
- if h then
- h.write( content )
- h.close()
- else
- print "Failed to write file"
- return
- end
- else
- print "Failed to fetch file"
- return
- end
- end
- local function movefile( file )
- if fs.exists( "old" .. file ) then
- movefile( "old" .. file )
- end
- fs.move( file, "old" .. file )
- end
- if fs.exists "startup" then
- movefile "startup"
- end
- local h = fs.open( "startup", "w" )
- if h then
- h.write [[shell.run "Phoenix/init.lua"]]
- h.close()
- else
- print "Failed to write startup"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement