Advertisement
xeritt

Nick Chi LuaShell

Aug 26th, 2018
183
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print ("OpenOS Nick Chi Shell 1.1")
  2. --local arg = {...}
  3. --local proxy
  4. local fs = require("filesystem")
  5. local dir = "/mnt"
  6. local binpath = '/home/bin'
  7. local etcpath = '/home/etc'
  8.  
  9.  
  10. local shell = require('shell')
  11.  
  12. -- Добавить свой путь для своих скриптов
  13. print('Добавить свой путь для своих скриптов :', binpath);
  14. shell.setPath(shell.getPath() .. ":"..binpath)
  15.  
  16. local function installSoft(namesoft, pastebinid)
  17.     local filename = binpath..'/'..namesoft..'.lua';
  18.     local mc_success, mc_reason = shell.execute('wget https://pastebin.com/raw/'..pastebinid..' '..filename)
  19.     if not mc_success then
  20.         print(mc_reason)
  21.     else
  22.         print ("Установка ["..namesoft.."] .. ok!")
  23.     end
  24. end
  25.  
  26. local function installEtc()
  27.     local success, reason = shell.execute('mkdir '..etcpath)
  28.     if not success then
  29.         print(reason)
  30.     else
  31.     end
  32. end
  33.  
  34. local function installConfig(confname, pastebinid)
  35.     local filename = etcpath..'/'..confname;
  36.     local mc_success, mc_reason = shell.execute('wget https://pastebin.com/raw/'..pastebinid..' '..filename)
  37.     if not mc_success then
  38.         print(mc_reason)
  39.     else
  40.         print ("Установка ["..filename.."] .. ok!")
  41.     end
  42. end
  43.  
  44.  
  45. -- Загрузка ПО
  46. print ("Загрузка и установка ПО")
  47. installEtc()
  48. local success, reason = shell.execute('mkdir '..binpath)
  49. if not success then
  50.     print(reason)
  51. else
  52.     shell.execute('echo /home/bin/myresolution.lua > /home/.shrc')
  53.     print ("Edit /home/.shrc ")
  54.     installSoft('mc','kE3jp6nD')
  55.     installSoft('mc2','NRiG4D8M')
  56.     installSoft('fire','qcibULvS')
  57.     installSoft('send','drLwaFrX')
  58.     installSoft('red','Hew7P7uY')
  59.     installSoft('modem_getmes','WfPMz5Kn')
  60.     installSoft('myresolution','aSnCpH2c')
  61.     installSoft('medit','aMyJZkVr')
  62.     installConfig('edit.cfg','aMyJZkVr')
  63.     installSoft('snd','dkk9HgsG')
  64.     installSoft('ftp','UPcwLA9e')
  65.  
  66.  
  67.  
  68. -- Ставим либы
  69.     shell.execute('pastebin get E0SzJcCx /lib/thread.lua')
  70. --http://computercraft.ru/topic/634-mnogopotochnost-v-opencomputers/
  71. -- shell.execute('pastebin get iKzRve2g /lib/forms.lua')
  72. --http://computercraft.ru/topic/1016-oc-lyogkaia-biblioteka-gui/
  73.     shell.execute('pastebin run ryhyXUKZ')
  74. --https://github.com/IgorTimofeev/GUI
  75. --pastebin run 0nm5b1ju
  76.   shell.execute('pastebin get KNmLY5vX /lib/highlighter.lua')
  77.  
  78.  
  79.  
  80. end
  81. print ("Установка ПО завершена")
Advertisement
RAW Paste Data Copied
Advertisement