FalloutOS/update_falloutOS.lua

86 lines
No EOL
2.6 KiB
Lua
Executable file

print("Please Stand By...")
print("ROBCO INDUSTRIES (TM) SOFTWARE UPDATE")
print("Updating ROBCO OS")
if(fs.exists("/fos")) then
if(fs.exists("/fos/fallout_craftos.lua")) then
else
print("!! NO CURRENT ROBCO OS DETECTED !!")
end
shell.run("delete /fos" )
shell.run("mkdir /fos")
else
shell.run("mkdir /fos")
end
if not fs.exists("/fosdata") then
shell.run("mkdir /fosdata")
end
shell.run("cd /fos")
shell.run("wget https://git.zontreck.com/zontreck/FalloutOS/raw/branch/master/fallout_craftos.lua")
shell.run("wget https://git.zontreck.com/zontreck/FalloutOS/raw/branch/master/programs/updateWordList.lua")
shell.run("wget https://git.zontreck.com/zontreck/FalloutOS/raw/branch/master/programs/version.lua")
shell.run("wget https://git.zontreck.com/zontreck/FalloutOS/raw/branch/master/programs/mainMenu.lua")
shell.run("wget https://git.zontreck.com/zontreck/FalloutOS/raw/branch/master/programs/deps/settingsFile.lua")
shell.run("wget https://git.zontreck.com/zontreck/FalloutOS/raw/branch/master/programs/deps/header.lua")
shell.run("wget https://git.zontreck.com/zontreck/FalloutOS/raw/branch/master/programs/setupCompleted.lua")
shell.run("wget https://git.zontreck.com/zontreck/FalloutOS/raw/branch/master/programs/setHostname.lua")
shell.run("wget https://git.zontreck.com/zontreck/FalloutOS/raw/branch/master/programs/setUser.lua")
shell.run("wget https://git.zontreck.com/zontreck/FalloutOS/raw/branch/master/programs/setAdminPin.lua")
print("")
print("ROBCO OS - UPDATING SOFTWARE UPDATER")
sleep(5)
if not fs.exists("/startup") then
shell.run("mkdir /startup")
end
shell.run("cd /startup")
if(fs.exists("/startup/bootstrap.lua")) then
shell.run("delete /startup/bootstrap.lua")
print("!! REMOVED OLD BOOTLOADER")
end
shell.run("cd /startup")
shell.run("wget https://git.zontreck.com/zontreck/FalloutOS/raw/branch/master/bootstrap.lua")
print("")
print("ROBCO UPDATER READY")
sleep(1)
print("ROBCO INDUSTRIES (TM) TERMLINK")
print("Now loading")
local textColor = colors.lime
term.setBackgroundColor(colors.black)
term.setTextColor(textColor)
sleep(5)
--returns one valid hex num (random)
function randomHex()
local possible = {'A','B','C','D','E','F'}
for i=0,9 do
table.insert(possible,i)
end
return(possible[math.random(1,#possible)])
end
local i=0
for i=0,50 do
-- 4 groups of hex, 4 digits each
local hexStr = ""
for v=0,4 do
hexStr = hexStr.." 0x"
for x=0,4 do
hexStr = hexStr..randomHex()
end
end
print(hexStr)
sleep(0.025)
end
print("Startup Complete")
sleep(1)
shell.run("cd /fos")
shell.run("/fos/fallout_craftos.lua")