Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("tima repository 1.0")
- write("Program: ")
- var = read()
- print("Connecting to repository...")
- d = "http://192.168.1.129:8000/repository/"
- e = var
- local a = http.get(d..e)
- c = a.readAll()
- if (c == "") or (c == " ") then
- error("file not found!")
- end
- a.close()
- if (fs.exists(var)) or (fs.exists("/timaprog/"..var)) then
- error("file exists")
- end
- if c == "" then
- error("file not found!")
- else
- b = fs.open(var, "w")
- b.writeLine(c)
- b.close()
- as = "timaprog/"
- if fs.exists(as..var) then
- print("program ", var, " is exists.")
- else
- print("Downloading packages...")
- shell.run("mkdir /timaprog")
- print("installing packages...")
- shell.run("cp "..var.." /timaprog")
- shell.run("rm "..var)
- print("Done!")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement