Update update update

This commit is contained in:
Ben 2024-06-01 03:19:54 +02:00
parent 49386888c0
commit 4a06da1233
Signed by: ben
GPG key ID: 1353F41CF1CFF2D3

View file

@ -1,9 +1,29 @@
if fs.exists("permset.lua") then function update_update()
fs.delete("permset.lua") if fs.exists("update.lua.old") then
fs.delete("update.lua.old")
else
if fs.exists("update.lua") then
fs.move("update.lua", "update.lua.old")
end
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
shell.run("update")
-- re-ran update, don't continue in this instance
return false
end
end
return true
end end
shell.execute("wget", "https://gitea.rs485.network/ben/cc/raw/branch/main/permset.lua", "permset.lua")
if fs.exists("test.lua") then
fs.delete("test.lua") if update_update() then
if fs.exists("permset.lua") then
fs.delete("permset.lua")
end
shell.execute("wget", "https://gitea.rs485.network/ben/cc/raw/branch/main/permset.lua", "permset.lua")
if fs.exists("test.lua") then
fs.delete("test.lua")
end
shell.execute("wget", "https://gitea.rs485.network/ben/cc/raw/branch/main/test.lua", "test.lua")
shell.run("test")
end end
shell.execute("wget", "https://gitea.rs485.network/ben/cc/raw/branch/main/test.lua", "test.lua")
shell.run("test")