initial commit with all the stuff
This commit is contained in:
45
2B+Software/app/cfg.lua
Normal file
45
2B+Software/app/cfg.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
modules = {"panel","app","locale"};
|
||||
|
||||
---------------- Application module app configuration ---------------
|
||||
|
||||
app = {}
|
||||
require "app"
|
||||
|
||||
function app.apply()
|
||||
print(
|
||||
"<br><b><center>Apply module app !</center></b><br>"..
|
||||
"<center>Damit die Änderungen wirksam werden, musste die Anwendung neu gestartet werden !</center><br>"
|
||||
);
|
||||
os.execute("/root/ctrlapp stop")
|
||||
os.execute("sleep 2")
|
||||
os.execute("/root/ctrlapp start")
|
||||
end
|
||||
|
||||
function app.validate()
|
||||
print("<br><b><center>Validate modlue app !</center></b><br>");
|
||||
end
|
||||
|
||||
---------------- Witty Administration localisation ------------------
|
||||
|
||||
locale = {}
|
||||
require "locale";
|
||||
|
||||
---------------- Witty Administration Tabs configuration ------------
|
||||
|
||||
tabs = {}
|
||||
require "tabs";
|
||||
|
||||
panel = {};
|
||||
require "panel"
|
||||
|
||||
function panel.apply()
|
||||
local mqttBroker = app.mqttBroker[1]
|
||||
local mqttRoot = app.mqttRoot[1]
|
||||
print(
|
||||
"<br><b><center>Apply module panel !</center></b><br>"..
|
||||
"<center>Damit die Änderungen wirksam werden, wird die Konfiguration via MQTT publiziert !</center><br>"
|
||||
);
|
||||
os.execute("mosquitto_pub -h "..mqttBroker.. " -t "..mqttRoot.."/ctrl/cmd/panel/config -m apply")
|
||||
os.execute("sleep 2")
|
||||
os.execute("mosquitto_pub -h "..mqttBroker.. " -t "..mqttRoot.."/ctrl/cmd/panel/config -m publish")
|
||||
end
|
||||
Reference in New Issue
Block a user