Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variables --
- local tArgs = {...}
- local databaseURL = "https://dl.dropbox.com/u/6320944/apt-get/database"
- local databaseSoruce = {}
- -- Functions --
- local function fileSystemSetup()
- if not fs.exists("/.apt-get/") then
- fs.makeDir("/.apt-get/")
- fs.makeDir("/.apt-get/database")
- end
- end
- local function getHttp(url, save)
- local request = http.get(url)
- if type(request) == "table" then
- f = fs.open(save, "w")
- f.write(request.readAll())
- f.close()
- return true
- else
- return false
- end
- end
- local function getPastebin(code, save)
- getHttp("http://pastebin.com/raw.php?i=" ..code)
- end
- local function databaseUpdate()
- f = fs.open("/.apt-get/source")
- databaseSoruce = textutils.unserialize(f.readAll())
- f.close()
- for k, v in pairs(databaseSoruce) do
- getHttp(v, "/.apt-get/database/" ..k)
- end
- end
- -- Main --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement