Meow[ajs[df0onaes[d

This commit is contained in:
Gvidas Juknevičius 2025-06-02 10:42:08 +03:00
parent d72dd57e6a
commit 8026749270
Signed by: MCorange
GPG Key ID: 5BE6B533CB76FE86

View File

@ -2,12 +2,13 @@ local CURRENT_CLIENT_VERSION = "1.0.0.2"
local INSTALL_PATH = "/"
function http_get(url)
local req = http.get(url)
local resp = req.readAll()
req.close()
return resp
local req = http.get(url)
if not req then
print("FAIL " .. url)
end
local resp = req.readAll()
req.close()
return resp
end
print("Device Version: " .. CURRENT_CLIENT_VERSION)
@ -17,20 +18,19 @@ local manifest = http_get("https://git.mcorangehq.xyz/xomf/slabOS/raw/branch/mai
local manifest_json = textutils.unserialiseJSON(manifest)
print("Latest: " .. manifest_json.version)
if manifest_json.version ~= CURRENT_CLIENT_VERSION then
print("Installing update...")
print("Installing update...")
for path,url in pairs(manifest_json.sys_files) do
print("Writing " .. path)
local file = fs.open(INSTALL_PATH .. path, "w")
file.write( http_get(url) )
file.close()
print("Written.")
end
for path, url in pairs(manifest_json.sys_files) do
print("W " .. path)
local file = fs.open(INSTALL_PATH .. path, "w")
file.write(http_get(url))
file.close()
-- print("Written.")
end
print("Please reboot your device.")
os.reboot()
print("Please reboot your device.")
os.reboot()
else
print("No update availiable.")
end
print("No update availiable.")
end