Create setup.lua

working on making a setup script for essentially computercraft dotfiles
This commit is contained in:
CadenCoaster
2025-08-05 20:31:19 -07:00
committed by GitHub
parent 14ff947899
commit e505617291

26
setup.lua Normal file
View File

@@ -0,0 +1,26 @@
local function isYes(str)
if str:lower():find("n") then
return false
end
return true
end
term.write("setup netmountcc? (Y/n)")
if isYes(read()) then
term.write("url: ")
local url = read()
term.write("user: ")
local user = read()
term.write("pass: ")
local pass = read("*")
if http.checkURL(url) then
settings.set("netmount.username",user)
settings.set("netmount.password",pass)
settings.set("netmount.path","/cloud")
fs.makeDir("/startup")
local file = fs.open("/startup/-01_mount.lua","w")
file.write(http.get(url.."/mount.lua").readAll())
file.close()
end
end