feat: Add auto-update startup scripts for turtle, webbridge, and pocket computers

This commit is contained in:
MayaTheShy
2026-02-20 00:23:03 -05:00
parent baa807ed2a
commit 544c5be954
4 changed files with 233 additions and 0 deletions

56
startup_turtle.lua Normal file
View File

@@ -0,0 +1,56 @@
-- Turtle Startup Script
-- Automatically downloads and runs the latest turtle.lua from git
local SCRIPT_URL = "https://git.spatulaa.com/MayaTheShy/remoteturtle/raw/branch/master/turtle.lua"
local SCRIPT_NAME = "turtle.lua"
print("========================================")
print(" TURTLE AUTO-UPDATER")
print("========================================")
print("")
-- Remove old version
if fs.exists(SCRIPT_NAME) then
print("Removing old version...")
fs.delete(SCRIPT_NAME)
end
-- Download latest version
print("Downloading latest version...")
print("URL: " .. SCRIPT_URL)
local response = http.get(SCRIPT_URL)
if response then
local content = response.readAll()
response.close()
-- Save to file
local file = fs.open(SCRIPT_NAME, "w")
file.write(content)
file.close()
print("✓ Download successful!")
print("")
print("Starting turtle program...")
sleep(1)
-- Run the script
shell.run(SCRIPT_NAME)
else
print("✗ Download failed!")
print("Please check:")
print(" - Internet connection")
print(" - URL is correct")
print(" - HTTP API is enabled")
print("")
print("Falling back to existing script...")
-- Try to run existing version if download fails
if fs.exists(SCRIPT_NAME) then
shell.run(SCRIPT_NAME)
else
print("No existing script found!")
print("Please download manually:")
print(" wget " .. SCRIPT_URL .. " " .. SCRIPT_NAME)
end
end