Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- updateloop = 0
- fupdateargs = {...}
- while true do
- if fs.isDir(udloc) == false then
- fs.makeDir(udloc)
- end
- os.run({}, "cd", udloc)
- if fs.exists(updateprogram.."new") then
- shell.run("delete",updateprogram.."new")
- end
- shell.run("pastebin","get",pastelink,updateprogram.."new")
- if fs.exists(updateprogram.."new") then
- if fs.exists(updateprogram.."old") then
- shell.run("delete",updateprogram.."old")
- end
- if fs.exists("Farm") then
- shell.run("rename",updateprogram,updateprogram.."old")
- end
- shell.run("rename",updateprogram.."new",updateprogram)
- if fs.exists(updateprogram) then
- break
- end
- end
- if fs.exists(updateprogram) then
- if updateloop > 20 then
- break
- end
- end
- if fs.exists(updateprogram.."old") then
- if updateloop > 30 then
- shell.run("rename",updateprogram.."old",updateprogram)
- if fs.exists(updateprogram) then
- break
- end
- end
- end
- updateloop = updateloop + 1
- end
- local _, countsl = string.gsub(udloc,"/","")
- countsl = countsl + 1
- if startupls ~= "none" or startupls ~= nil then
- local stu = fs.open("startup.lua", "w")
- stu.write(startupls)
- stu.close()
- end
- if updatefunargs ~= nil or updatefunargs ~= "none" then
- shell.run(updateprogram .. "," .. unpack(updateargs))
- else
- shell.run(updateprogram)
- end
- for i=1,countsl do
- shell.run("cd", "..")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement