Fix keeping update.lua.old
This commit is contained in:
parent
4a06da1233
commit
b575517317
12
update.lua
12
update.lua
|
@ -6,10 +6,14 @@ function update_update()
|
||||||
fs.move("update.lua", "update.lua.old")
|
fs.move("update.lua", "update.lua.old")
|
||||||
end
|
end
|
||||||
shell.execute("wget", "https://gitea.rs485.network/ben/cc/raw/branch/main/update.lua", "update.lua")
|
shell.execute("wget", "https://gitea.rs485.network/ben/cc/raw/branch/main/update.lua", "update.lua")
|
||||||
if fs.exists("update.lua.old") and fs.getSize("update.lua.old") ~= fs.getSize("update.lua") then
|
if fs.exists("update.lua.old") then
|
||||||
shell.run("update")
|
if fs.getSize("update.lua.old") ~= fs.getSize("update.lua") then
|
||||||
-- re-ran update, don't continue in this instance
|
shell.run("update")
|
||||||
return false
|
-- re-ran update, don't continue in this instance
|
||||||
|
return false
|
||||||
|
else
|
||||||
|
fs.delete("update.lua.old")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in a new issue