Easymesh.sh run on save/apply

main
riley 1 year ago
parent 9e5df69308
commit 5bedb6b315

@ -118,7 +118,7 @@ o.rmempty = false
o = s:taboption("setup", ListValue, "role", translate("Mesh Mode"))
o:value("off", translate("Node"))
o:value("server", translate("Server"))
o:value("client", translate("Client (advanced)"))
--o:value("client", translate("Client (advanced)"))
o:depends("enabled", 1)
o.rmempty = false
@ -231,14 +231,13 @@ ctrl.anonymous = true
ctrl.addremove = false
btnStart = ctrl:option(Button, "_btn_start", translate("Enable Easy Mesh"))
function btnStart.write()
io.popen("/easymesh/easymesh.sh start")
function m.on_after_commit(self)
local enabled = m:formvalue("cbid.easymesh.easymesh.enabled")
if enabled and enabled == "1" then
luci.sys.call("/easymesh/easymesh.sh start &")
else
luci.sys.call("/easymesh/easymesh.sh stop &")
end
btnStop = ctrl:option(Button, "_btn_stop", translate("Disable Easy Mesh"))
function btnStop.write()
io.popen("/easymesh/easymesh.sh stop")
end
function o.write(self, section, value)

Loading…
Cancel
Save