Marlingaming

CC Tweaked Boot Script

Jan 5th, 2022 (edited)
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.31 KB | None | 0 0
  1. --this is the startup script for the C.S.P Device
  2. version = "1.0.0"
  3. settings.load(".settings")
  4. local w, h = term.getSize()
  5. function BootStart()
  6. term.setBackgroundColor(colors.black)
  7. term.clear()
  8. term.setCursorPos(1,1)
  9. print("Running Security Scan")
  10. print("===Security Scan Unavailable===")
  11. print("Security Scan Complete!")
  12. os.sleep(5)
  13. term.clear()
  14. term.setCursorPos(1,1)
  15. if settings.get("os_BootMode") == true then
  16.     print("starting Quick Boot Process")
  17.     QuickBoot()
  18. else
  19.     print("starting full Boot Process")
  20.     FullBoot()
  21. end
  22. end
  23.  
  24. function FullBoot()
  25. print("Checking for Updates")
  26. os.sleep(6)
  27. if settings.get("Allow_OsUpdates") == true then
  28.     shell.run("os/os_Programs/os_UpdateController","Boot")
  29. else
  30.  
  31.     print("This Version does not allow")
  32.     print("Updating of OS")
  33.     print("Please contact Adminstrator")
  34.     print("to Enable this")
  35. end
  36. os.sleep(2)
  37. term.setBackgroundColor(colors.blue)
  38. term.clear()
  39. term.setCursorPos(1,1)
  40. if fs.exists("os/os_SystemFiles/setupCompleted") == true then
  41.     print("Device Settings Detected")
  42. else
  43.     print("Setup File not found")
  44.     print("Starting Setup Program")
  45.     os.sleep(3)
  46.     shell.run( "pastebin","run","D9qE5rtF")--runs online Setup script
  47. end
  48.  
  49. os.sleep(2)
  50. term.clear()
  51. term.setCursorPos(1,1)
  52. BootEnd()
  53. end
  54.  
  55. function QuickBoot()
  56. term.setBackgroundColor(colors.blue)
  57. term.clear()
  58. if fs.exists("os/os_SystemFiles/setupCompleted") == true then
  59.     print("Device Settings Detected")
  60. else
  61.     print("Setup File not found")
  62.     print("Starting Setup Program")
  63.     os.sleep(2)
  64.     shell.run( "pastebin","run","D9qE5rtF")--runs online Setup script
  65. end
  66. os.sleep(2)
  67. term.clear()
  68. term.setCursorPos(1,1)
  69. BootEnd()
  70. end
  71.  
  72.  
  73. function BootEnd()
  74. local Flag = paintutils.loadImage("os/os_SystemFiles/Images/NationalFlag01_Small")
  75. print("----=================----")
  76. print(os.date())
  77. print("Boot Completed")
  78. print("Starting Main Script")
  79. print("----=================----")
  80. paintutils.drawFilledBox(1,6,w,20,colors.white)
  81. paintutils.drawImage(Flag,1,7)
  82. os.sleep(8)
  83. term.clear()
  84. term.setCursorPos(1,1)
  85. local Tasks = {settings.get("os_startApps")}
  86. if Tasks[1] == "Example" then
  87.     print("No Start List Found")
  88. else
  89.     for i = 1, #Tasks do
  90.         shell.run(shell.resolve(Tasks[i]))
  91.     end
  92. end
  93. shell.run("os/os_Programs/os_startScreen",settings.get("os_LockScreenPassword"))
  94. end
  95.  
  96.  
  97. BootStart()
Add Comment
Please, Sign In to add comment