cc-mek-scada/startup.lua

36 lines
1.1 KiB
Lua
Raw Permalink Normal View History

2022-05-11 15:31:02 +00:00
local util = require("scada-common.util")
local println = util.println
local BOOTLOADER_VERSION = "1.0"
2022-05-11 15:31:02 +00:00
println("SCADA BOOTLOADER V" .. BOOTLOADER_VERSION)
println("BOOT> SCANNING FOR APPLICATIONS...")
2022-05-11 15:31:02 +00:00
local exit_code
2022-05-11 15:31:02 +00:00
if fs.exists("reactor-plc/startup.lua") then
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
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
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
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
println("BOOT> EXEC POCKET STARTUP")
2022-05-11 15:31:02 +00:00
exit_code = shell.execute("pocket/startup")
else
println("BOOT> NO SCADA STARTUP FOUND")
2022-05-11 15:31:02 +00:00
println("BOOT> EXIT")
return false
end
if not exit_code then println("BOOT> APPLICATION CRASHED") end
2022-05-11 15:31:02 +00:00
return exit_code