Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- __version = "1.2.1"
- local args = {...}
- local function has_value (tab, val)
- for index, value in ipairs(tab) do
- if value == val then
- return true
- end
- end
- return false
- end
- shell.setDir("/")
- shell.setPath(shell.path()..":/bin:/usr/bin")
- fs.delete("/tmp")
- fs.makeDir("/tmp")
- if args == nil or has_value(args, "--suppress-updates") == false then
- write("Checking for ")
- term.setTextColor(colors.cyan)
- write("Diamond OS ")
- term.setTextColor(colors.white)
- print("updates")
- shell.run("pastebin get C4AXnTiu /tmp/versionInfo")
- if fs.exists("/tmp/versionInfo") then
- local file = io.open("/tmp/versionInfo", "r")
- local version = file:read()
- file:close()
- fs.delete("/tmp/versionInfo")
- if version ~= __version then
- term.setTextColor(colors.cyan)
- write("Diamond OS " .. version)
- term.setTextColor(colors.white)
- print(" is available!")
- print("downloading updater at '/tmp/update'!")
- print("copy all files from update folder to floppy disk")
- if fs.exists("/tmp/update") then
- shell.run("delete /tmp/update")
- end
- sleep(2)
- shell.run("mkdir /tmp/update/")
- shell.run("mkdir /tmp/update/bios/")
- shell.run("mkdir /tmp/update/diamondOS/")
- shell.run("mkdir /tmp/update/diamondOS/os/")
- shell.run("mkdir /tmp/update/diamondOS/os/boot/")
- shell.run("mkdir /tmp/update/diamondOS/os/bin/")
- shell.run("mkdir /tmp/update/diamondOS/os/etc/")
- shell.run("mkdir /tmp/update/diamondOS/os/home/")
- shell.run("mkdir /tmp/update/diamondOS/os/lib/")
- shell.run("mkdir /tmp/update/temp/")
- shell.run("pastebin get xy5Xbu8d /tmp/update/startup")
- shell.run("pastebin get 5Zbtsqcp /tmp/update/bios/startup.bios")
- shell.run("pastebin get dpELuj8e /tmp/update/diamondOS/back.lua")
- shell.run("pastebin get eggHuRDr /tmp/update/diamondOS/os/usr/bin/sendFiles")
- shell.run("pastebin get XVFay6kL /tmp/update/diamondOS/os/usr/bin/getFiles")
- shell.run("pastebin get n0TYWPg0 /tmp/update/diamondOS/os/usr/bin/browser")
- shell.run("pastebin get 5Zbtsqcp /tmp/update/diamondOS/os/boot/startup")
- shell.run("pastebin get WsCzE6yg /tmp/update/diamondOS/os/boot/recovery.lua")
- shell.run("pastebin get Ss3Xm8Gs /tmp/update/diamondOS/os/boot/boot.lua")
- shell.run("pastebin get PSp7HphJ /tmp/update/diamondOS/os/boot/craftbootloader.lua")
- shell.run("pastebin get MKAUF1aB /tmp/update/diamondOS/os/boot/init")
- shell.run("pastebin get nH47yXMJ /tmp/update/diamondOS/os/bin/.command")
- shell.run("pastebin get u5nCuSmc /tmp/update/diamondOS/os/bin/.programs")
- shell.run("pastebin get T4hMDcjM /tmp/update/diamondOS/os/bin/.shutdown")
- shell.run("pastebin get Z2TD7KJD /tmp/update/diamondOS/os/bin/.sleep")
- shell.run("pastebin get w4XWgvcZ /tmp/update/diamondOS/os/bin/install")
- shell.run("pastebin get dvFUiJ7k /tmp/update/diamondOS/os/bin/.uninstall")
- shell.run("pastebin get zdSEmGNM /tmp/update/diamondOS/os/bin/.UninstallDialog")
- shell.run("pastebin get NtKBPusE /tmp/update/diamondOS/os/bin/BSOD")
- shell.run("pastebin get tdiZwXAi /tmp/update/diamondOS/os/bin/main")
- shell.run("pastebin get 0iexJb9q /tmp/update/diamondOS/os/bin/ncBSOD")
- shell.run("pastebin get wXKUuzNx /tmp/update/diamondOS/os/bin/.about")
- shell.run("pastebin get GF9tLvZ6 /tmp/update/diamondOS/os/bin/capule.lua")
- shell.run("pastebin get v5XWn99E /tmp/update/diamondOS/os/lib/config.lua")
- shell.run("pastebin get u5BjvyFe /tmp/update/diamondOS/os/lib/exceptions.lua")
- shell.run("pastebin get iLY3Jeuc /tmp/update/diamondOS/os/lib/express.lua")
- shell.run("pastebin get PNEh7K7s /tmp/update/diamondOS/os/lib/string.lua")
- shell.run("pastebin get MzrE4pWW /tmp/update/diamondOS/os/lib/url.lua")
- shell.run("pastebin get kEqLGkrW /tmp/update/diamondOS/os/lib/uuid.lua")
- shell.run("pastebin get ZswRgdCB /tmp/update/diamondOS/os/lib/cache.lua")
- shell.run("pastebin get bmE3aTzv /tmp/update/diamondOS/os/lib/crypto/sha2.lua")
- shell.run("pastebin get swWJdc7X /tmp/update/diamondOS/os/lib/args.lua")
- shell.run("pastebin get UCx4aiR0 /tmp/update/diamondOS/os/lib/binary.lua")
- shell.run("pastebin get QyJL90XJ /tmp/update/diamondOS/os/lib/cache.lua")
- shell.run("pastebin get abFf6TPB /tmp/update/diamondOS/os/lib/logger.lua")
- shell.run("pastebin get TQxHVC6D /tmp/update/diamondOS/os/lib/print-utils.lua")
- shell.run("pastebin get KUjYeHfm /tmp/update/diamondOS/os/lib/stringbuilder.lua")
- shell.run("wget https://github.com/SiliconSloth/CryptoNet/raw/master/cryptoNet.lua /tmp/update/diamondOS/os/lib/crypto/net/cryptoNet.lua")
- shell.run("wget https://gist.github.com/1lann/6604c8d3d8e5fdad0832/raw/9dee2620c504b44a1ea5c8882c0395110fcc38d7/rsa-crypt.lua /tmp/update/diamondOS/os/lib/crypto/rsa.lua")
- shell.run("wget https://gist.github.com/1lann/c9d4d2e7c1f825cad36b/raw/d18b466be8a88eca32fa58e023270640cb57678d/rsa-keygen.lua /tmp/update/diamondOS/os/lib/crypto/rsa_gen.lua")
- shell.run("pastebin get 8VTiuDBx /tmp/update/temp/cancel.lua")
- shell.run("pastebin get pRKZLKge /tmp/update/temp/install.lua")
- shell.run("pastebin get c80ZXcqT /tmp/update/temp/.deletetemp.lua")
- print("Opening terminal...")
- error()
- else
- term.setTextColor(colors.red)
- print("No update available")
- term.setTextColor(colors.white)
- end
- else
- shell.run("/bin/BSOD", "\"[DO:0001] No or corrupted file\"")
- end
- else
- print("Running with suppress updates option!\nSkipping...")
- end
- term.clear()
- term.setCursorPos(1,1)
- shell.run("/bin/main")
Advertisement
Add Comment
Please, Sign In to add comment