Advertisement
ecoMeco

aos install

Aug 22nd, 2016
589
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.07 KB | None | 0 0
  1. local function install()
  2.     if (not fs.exists("/usr/bin/packman")) and (not fs.exists("/usr/apis/package")) then
  3.         print(":: Downloading packman installer")
  4.         local pmi = http.get("http://pastebin.com/raw/4zyreNZy")
  5.             local pmi_f = fs.open(".pmi", "w")
  6.                 pmi_f.write(pmi.readAll())
  7.             pmi_f.close()
  8.         pmi.close()
  9.         print(":: Installing packman")
  10.         shell.run(".pmi")
  11.         print(":: Cleaning up")
  12.         fs.delete(".pmi")
  13.     end
  14.     print(":: Installing admicos/admios-full")
  15.     shell.run("packman force install admicos/admios-full")
  16.     print(":: DONE! (press any key to reboot)")
  17.     os.pullEvent("key")
  18.     os.reboot()
  19. end
  20.  
  21. local function main()
  22.     if _ADMIOS then
  23.         error("AdmiOS is already installed.")
  24.     end
  25.     print("Are you sure you want to continue? [yN]")
  26.     local k = {os.pullEvent("key")}
  27.     if k[2] == keys.y then
  28.         install()
  29.     else
  30.         sleep(.01) --to make sure the character doesnt get entered to the shell.
  31.         print("ok. bye")
  32.     end
  33. end main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement