Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local paste = "vb20x1J9"
- local startup = "startup"
- local config = "item"
- term.clear()
- term.setCursorPos(1, 1)
- print("--- Potion Dispenser Node Installer ---")
- print("Enter the item name of this node")
- print("Enter nothing to skip configuration")
- local configData = read()
- -- delete old startup file
- term.clear()
- print("Checking for old startup file")
- if(fs.exists(startup)) then
- print("Old startup file found, deleting...")
- fs.delete(startup)
- end
- -- download new startup file
- term.clear()
- print("Downloading Node Program")
- shell.run("pastebin", "get", paste, startup)
- -- set config
- if configData ~= "" then
- term.clear()
- print("Creating configuration file: " .. config .. " with data: " .. configData)
- local file = fs.open(config, "w")
- if file then
- file.writeLine(configData)
- file.close()
- else
- print("ERROR: could not create config file: " .. config)
- end
- end
- print("Rebooting")
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement