entry({"admin", "network", "mwan", "configuration", "rule"},
arcombine(cbi("mwan/rule"), cbi("mwan/ruleconfig")),
_("Rules"), 40).leaf = true
+ entry({"admin", "network", "mwan", "configuration", "notify"},
+ cbi("mwan/notify"),
+ _("Notification"), 50).leaf = true
entry({"admin", "network", "mwan", "advanced"},
- alias("admin", "network", "mwan", "advanced", "hotplugscript"),
+ alias("admin", "network", "mwan", "advanced", "mwanconfig"),
_("Advanced"), 100)
- entry({"admin", "network", "mwan", "advanced", "hotplugscript"},
- form("mwan/advanced_hotplugscript"))
entry({"admin", "network", "mwan", "advanced", "mwanconfig"},
form("mwan/advanced_mwanconfig"))
entry({"admin", "network", "mwan", "advanced", "networkconfig"},
+++ /dev/null
--- ------ hotplug script configuration ------ --
-
-fs = require "nixio.fs"
-ut = require "luci.util"
-
-script = "/etc/mwan3.user"
-
-m5 = SimpleForm("luci", nil)
- m5:append(Template("mwan/advanced_hotplugscript")) -- highlight current tab
-
-f = m5:section(SimpleSection, nil,
- translate("This section allows you to modify the content of \"/etc/mwan3.user\".<br />" ..
- "The file is also preserved during sysupgrade.<br />" ..
- "<br />" ..
- "Notes:<br />" ..
- "This file is interpreted as a shell script.<br />" ..
- "The first line of the script must be "#!/bin/sh" without quotes.<br />" ..
- "Lines beginning with # are comments and are not executed.<br />" ..
- "Put your custom mwan3 action here, they will<br />" ..
- "be executed with each netifd hotplug interface event<br />" ..
- "on interfaces for which mwan3 is enabled.<br />" ..
- "<br />" ..
- "There are three main environment variables that are passed to this script.<br />" ..
- "<br />" ..
- "$ACTION Either \"ifup\" or \"ifdown\"<br />" ..
- "$INTERFACE Name of the interface which went up or down (e.g. \"wan\" or \"wwan\")<br />" ..
- "$DEVICE Physical device name which interface went up or down (e.g. \"eth0\" or \"wwan0\")<br />" ..
- "<br />"))
-
-t = f:option(TextValue, "lines")
- t.rmempty = true
- t.rows = 20
- function t.cfgvalue()
- return fs.readfile(script)
- end
- function t.write(self, section, data) -- format and write new data to script
- return fs.writefile(script, ut.trim(data:gsub("\r\n", "\n")) .. "\n")
- end
-
-return m5
--- /dev/null
+-- ------ hotplug script configuration ------ --
+
+fs = require "nixio.fs"
+ut = require "luci.util"
+
+script = "/etc/mwan3.user"
+
+m5 = SimpleForm("luci", nil)
+
+f = m5:section(SimpleSection, nil,
+ translate("This section allows you to modify the content of \"/etc/mwan3.user\".<br />" ..
+ "The file is also preserved during sysupgrade.<br />" ..
+ "<br />" ..
+ "Notes:<br />" ..
+ "This file is interpreted as a shell script.<br />" ..
+ "The first line of the script must be "#!/bin/sh" without quotes.<br />" ..
+ "Lines beginning with # are comments and are not executed.<br />" ..
+ "Put your custom mwan3 action here, they will<br />" ..
+ "be executed with each netifd hotplug interface event<br />" ..
+ "on interfaces for which mwan3 is enabled.<br />" ..
+ "<br />" ..
+ "There are three main environment variables that are passed to this script.<br />" ..
+ "<br />" ..
+ "$ACTION Either \"ifup\" or \"ifdown\"<br />" ..
+ "$INTERFACE Name of the interface which went up or down (e.g. \"wan\" or \"wwan\")<br />" ..
+ "$DEVICE Physical device name which interface went up or down (e.g. \"eth0\" or \"wwan0\")<br />" ..
+ "<br />"))
+
+t = f:option(TextValue, "lines")
+ t.rmempty = true
+ t.rows = 20
+ function t.cfgvalue()
+ return fs.readfile(script)
+ end
+ function t.write(self, section, data) -- format and write new data to script
+ return fs.writefile(script, ut.trim(data:gsub("\r\n", "\n")) .. "\n")
+ end
+
+return m5
<%+header%>
<ul class="cbi-tabmenu">
- <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
+++ /dev/null
-<ul class="cbi-tabmenu">
- <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
- <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
- <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
- <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
- <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li>
- <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li>
-</ul>
-
-<style type="text/css">
- .cbi-section {
- padding: 20px;
- }
-</style>
<ul class="cbi-tabmenu">
- <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
<li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
<ul class="cbi-tabmenu">
- <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
<li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
<%+header%>
<ul class="cbi-tabmenu">
- <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
<ul class="cbi-tabmenu">
- <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
<li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>