2022-05-11 15:31:02 +00:00
|
|
|
local util = require("scada-common.util")
|
|
|
|
|
|
|
|
local println = util.println
|
|
|
|
|
2024-02-19 19:27:02 +00:00
|
|
|
local BOOTLOADER_VERSION = "1.0"
|
2022-05-11 15:31:02 +00:00
|
|
|
|
2023-11-04 16:51:24 +00:00
|
|
|
println("SCADA BOOTLOADER V" .. BOOTLOADER_VERSION)
|
|
|
|
println("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
|
2023-11-04 16:51:24 +00:00
|
|
|
println("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
|
2023-11-04 16:51:24 +00:00
|
|
|
println("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
|
2023-11-04 16:51:24 +00:00
|
|
|
println("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
|
2023-11-04 16:51:24 +00:00
|
|
|
println("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
|
2023-11-04 16:51:24 +00:00
|
|
|
println("BOOT> EXEC POCKET STARTUP")
|
2022-05-11 15:31:02 +00:00
|
|
|
exit_code = shell.execute("pocket/startup")
|
|
|
|
else
|
2023-09-01 14:23:39 +00:00
|
|
|
println("BOOT> NO SCADA STARTUP FOUND")
|
2022-05-11 15:31:02 +00:00
|
|
|
println("BOOT> EXIT")
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
|
2023-11-04 16:51:24 +00:00
|
|
|
if not exit_code then println("BOOT> APPLICATION CRASHED") end
|
2022-05-11 15:31:02 +00:00
|
|
|
|
|
|
|
return exit_code
|