Advertisement
magik6000

MPT for oc installer

May 12th, 2014
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. local shell = require "shell"
  2. local fs = require "filesystem"
  3. print("select device to use: ")
  4. local av = {}
  5. for f in fs.list("/mnt") do
  6.     av[#av+1] = f
  7.     print(tostring(#av)..". "..f)
  8. end
  9. print("autorun.lua will be overwritten!")
  10. print("device:")
  11. local d = io.read()
  12. local path = "/mnt/"..av[tonumber(d)]
  13. local fh = fs.open(path.."autorun.lua","w")
  14. fh:write("os.setenv(\"APTROOT\",\""..path.."\")")
  15. fh:close()
  16. os.setenv("APTROOT",path)
  17. shell.execute("wget http://cc.nativehttp.org/p/mpt/mpt "..path.."mpt -f")
  18. shell.execute(path.."mpt init")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement