Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local systemFiles = {
- [ '/' ] = {
- [ 'startup' ] = 'Cmnq3tgk',
- },
- [ '/apps' ] = {
- [ 'shell' ] = '8WCbpxQs',
- [ 'multishell' ] = 'W2f3Uj1g',
- [ 'autorun.lua' ] = 'xwX617sw',
- [ 'update.lua' ] = 'tw70aUNq',
- [ 'Overview' ] = 'Ch56YsLX',
- [ 'Files' ] = 'zbffjQBg',
- [ 'Network' ] = 'tzUUFi3q',
- [ 'Lua' ] = 'sn41FFK3',
- [ 'Tabs' ] = 'PxMTTrpW',
- [ 'Peripherals' ] = '50xYxBzh',
- -- [ 'net.lua' ] = 'f8bav3Vt',
- [ 'Turtles' ] = 'kXRSXhDT',
- [ 'telnet.lua' ] = '0f4yAW6h',
- },
- [ '/autorun' ] = {
- [ 'network.daemon' ] = 'tzgzkKmY',
- [ 'device.daemon' ] = 'JbmTjdVH',
- },
- [ '/sys/apis' ] = {
- [ 'ui.api' ] = 'rnzi2X58',
- [ 'history.api' ] = '6HDeC2Kj',
- [ 'config.api' ] = 'NUzUVuR1',
- [ 'core.api' ] = '6bb08CWK',
- [ 'tracker.api' ] = 'v5WKccY9',
- [ 'socket.api' ] = 'rTaC5qF0',
- [ 'thread.api' ] = 'VB49zPTd',
- [ 'vos.api' ] = 'Exb20U1t',
- [ 'process.api' ] = 'BkbkdF9Y',
- [ 'me.api' ] = 'NQEbZcEU',
- },
- [ '/sys/config' ] = {
- [ 'repository' ] = 'GMRhVEuf',
- },
- [ '/sys/boot' ] = {
- [ 'default.boot' ] = 'M6iQXhjw',
- [ 'multishell.boot' ] = 'XsmCmfKu',
- },
- [ '/sys/network' ] = {
- [ 'telnet.plugin' ] = 'jbd9tV2n',
- [ 'snmp.plugin' ] = '0XtKbb1T',
- },
- [ '/apis' ] = {
- [ 'Util' ] = '0Lrqfxzy',
- [ 'Peripheral' ] = 'LpnyHhKf',
- },
- }
- local appFiles = {
- [ '/apps' ] = {
- [ 'cat.lua' ] = 'LX895Y5e',
- -- [ 'ls.lua' ] = 'DKUbgwKD',
- [ 'touch.lua' ] = 'SbPGTBqe',
- [ 'which.lua' ] = 'HybhbEEL',
- [ 'colors.lua' ] = 'TN7rE318',
- [ 'pb.lua' ] = 'e1CkBjhN',
- },
- }
- local turtleFiles = {
- [ '/apps' ] = {
- [ 't.lua' ] = 'wb43Gk19',
- },
- [ '/sys/network' ] = {
- [ 'turtle.plugin' ] = 'u87UtX53',
- },
- [ '/sys/apis' ] = {
- [ 'tl2.api' ] = 'mm1wiCH8',
- },
- }
- local storageMonitorFiles = {
- [ '/apps' ] = {
- [ 'storageMonitor.lua' ] = 'rByeECaM',
- },
- [ '/autorun' ] = {
- [ 'storageMonitor.lua' ] = 'aVF6BK51',
- },
- }
- local builderFiles = {
- [ '/sys/apis' ] = {
- [ 'profile.api' ] = 'RJZCHknF',
- [ 'tableDB.api' ] = 'F19nsmDw',
- [ 'schematic.api' ] = 'Z3u5zDxV',
- [ 'base64.api' ] = 'u59wCxBr',
- },
- [ '/apps' ] = {
- [ 'builder.lua' ] = 'bRsAtWe7',
- [ 'dl.lua' ] = 'zfiSjek5',
- },
- }
- local downloads = {
- system = systemFiles,
- apps = appFiles,
- }
- local allDownloads = {
- [ 'system' ] = { systemFiles },
- [ 'apps' ] = { appFiles },
- [ 'turtle' ] = { turtleFiles },
- [ 'storageMonitor' ] = { systemFiles, appFiles, turtleFiles, storageMonitorFiles },
- [ 'builder' ] = { systemFiles, appFiles, turtleFiles, builderFiles },
- }
- function download(downloads)
- for dir, files in pairs(downloads) do
- if not fs.exists(dir) then
- fs.makeDir(dir)
- end
- local tmpFile = '/.pastebin.tmp'
- for file, key in pairs(files) do
- local cmd = string.format(
- 'pastebin get %s %s',
- key, tmpFile)
- fs.delete(tmpFile)
- shell.run(cmd)
- if fs.exists(tmpFile) then
- local fullname = '/' .. fs.combine(dir, file)
- if fs.exists(fullname) then
- fs.delete(fullname)
- end
- fs.copy(tmpFile, fullname)
- end
- end
- fs.delete(tmpFile)
- end
- end
- local args = { ... }
- if #args == 0 then
- for _,v in pairs(downloads) do
- download(v)
- end
- if turtle then
- download(turtleFiles)
- end
- elseif allDownloads[args[1]] then
- local fileSets = allDownloads[args[1]]
- for _,v in pairs(fileSets) do
- download(v)
- end
- else
- printError('syntax:')
- printError('update or update <system, apps, turtle>')
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement