csmit195

MasterServer:Update

Sep 19th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local directory = 'masterserver'
  2. local programName = 'code'
  3.  
  4. -- Delete Everything
  5. print('Uninstalling existing applications, ignore the error')
  6. shell.run('rm /*')
  7.  
  8. -- Install APIs
  9. print('Installing Dependencies')
  10. shell.run('pastebin get 4nRg9CHU json')
  11.  
  12. -- Setup Directories
  13. print('Creating software directories')
  14. shell.run('mkdir /'..directory)
  15.  
  16. -- Install Scripts
  17. print('Downloading and Installing Software')
  18. shell.run('pastebin get rwGmxSfe /'..directory..'/'..programName)
  19.  
  20. -- Create Update File
  21. print('Creating update command')
  22. local startupFile = fs.open('/update', 'w')
  23. startupFile.write('shell.run(\'pastebin run 3sMnLmsn\')')
  24. startupFile.close()
  25.  
  26. -- Create Startup File
  27. print('Configuring device startup')
  28. local startupFile = fs.open('/startup', 'w')
  29. startupFile.write('shell.run(\''..directory..'/'..programName..'\')')
  30. startupFile.close()
  31.  
  32. print('Installation Complete, restarting device')
  33. os.reboot()
Add Comment
Please, Sign In to add comment