2024-06-29 19:11:16 +00:00
|
|
|
local BOOTLOADER_VERSION = "1.1"
|
2022-05-11 15:31:02 +00:00
|
|
|
|
2024-06-29 19:11:16 +00:00
|
|
|
print("SCADA BOOTLOADER V" .. BOOTLOADER_VERSION)
|
|
|
|
print("BOOT> SCANNING FOR APPLICATIONS...")
|
2022-05-11 15:31:02 +00:00
|
|
|
|
2023-11-04 16:51:24 +00:00
|
|
|
local exit_code
|
2022-05-11 15:31:02 +00:00
|
|
|
|
|
|
|
if fs.exists("reactor-plc/startup.lua") then
|
2024-06-29 19:11:16 +00:00
|
|
|
print("BOOT> EXEC REACTOR PLC STARTUP")
|
2022-05-11 15:31:02 +00:00
|
|
|
exit_code = shell.execute("reactor-plc/startup")
|
|
|
|
elseif fs.exists("rtu/startup.lua") then
|
2024-06-29 19:11:16 +00:00
|
|
|
print("BOOT> EXEC RTU STARTUP")
|
2022-05-11 15:31:02 +00:00
|
|
|
exit_code = shell.execute("rtu/startup")
|
|
|
|
elseif fs.exists("supervisor/startup.lua") then
|
2024-06-29 19:11:16 +00:00
|
|
|
print("BOOT> EXEC SUPERVISOR STARTUP")
|
2022-05-11 15:31:02 +00:00
|
|
|
exit_code = shell.execute("supervisor/startup")
|
|
|
|
elseif fs.exists("coordinator/startup.lua") then
|
2024-06-29 19:11:16 +00:00
|
|
|
print("BOOT> EXEC COORDINATOR STARTUP")
|
2022-05-11 15:31:02 +00:00
|
|
|
exit_code = shell.execute("coordinator/startup")
|
|
|
|
elseif fs.exists("pocket/startup.lua") then
|
2024-06-29 19:11:16 +00:00
|
|
|
print("BOOT> EXEC POCKET STARTUP")
|
2022-05-11 15:31:02 +00:00
|
|
|
exit_code = shell.execute("pocket/startup")
|
|
|
|
else
|
2024-06-29 19:11:16 +00:00
|
|
|
print("BOOT> NO SCADA STARTUP FOUND")
|
|
|
|
print("BOOT> EXIT")
|
2022-05-11 15:31:02 +00:00
|
|
|
return false
|
|
|
|
end
|
|
|
|
|
2024-06-29 19:11:16 +00:00
|
|
|
if not exit_code then print("BOOT> APPLICATION CRASHED") end
|
2022-05-11 15:31:02 +00:00
|
|
|
|
|
|
|
return exit_code
|