diff --git a/files/usr/local/bin/node-setup b/files/usr/local/bin/node-setup index 2ff7f733..5566038f 100755 --- a/files/usr/local/bin/node-setup +++ b/files/usr/local/bin/node-setup @@ -90,7 +90,7 @@ local dtdmac = mac_to_ip(aredn.hardware.get_interface_mac(lanintf:match("^(%S+)" local deleteme = {} local cfg = { lan_intf = lanintf, - wan_intf = "dummy", + wan_intf = aredn.hardware.get_board().network.wan.ifname, dtdlink_intf = aredn.hardware.get_bridge_iface_names('dtdlink') } diff --git a/files/usr/local/bin/wifi-setup b/files/usr/local/bin/wifi-setup index d0ca5af2..d4b009a3 100755 --- a/files/usr/local/bin/wifi-setup +++ b/files/usr/local/bin/wifi-setup @@ -55,14 +55,6 @@ done < $configfile meshif="$(uci -q get network.wifi.ifname)" meshphy="phy${meshif#wlan}" -# set physical wan interface in network - -wan_intf=`cat /etc/board.json|jsonfilter -e '@.network.wan.ifname'` -uci -c ${dropdir} -q batch > /dev/null <<-EOF -set network.wan.ifname="$wan_intf" -EOF -uci -c ${dropdir} -q commit network - rm -f "${dropdir}/wireless" touch "${dropdir}/wireless" diff --git a/files/www/cgi-bin/advancedconfig b/files/www/cgi-bin/advancedconfig index 5237de1a..5eb392a8 100755 --- a/files/www/cgi-bin/advancedconfig +++ b/files/www/cgi-bin/advancedconfig @@ -196,7 +196,8 @@ local settings = { key = "aredn.@tunnel[0].wanonly", type = "boolean", desc = "Prevents tunnel traffic from being routed over the mesh network itself.", - default = "1" + default = "1", + needreboot= true }, { key = "aredn.@meshstatus[0].lowmem", @@ -210,6 +211,14 @@ local settings = { desc = "When low memory is detected, limit the number of routes shown on the mesh status page", default = "1000" }, + { + key = "network.wan.ifname", + type = "string", + desc = "Specify WAN interface VLAN #. MUST be entered as ethX.YY where X is the interface (usually '0') and YY is the VLAN # to use.", + default = "", + postcallback = "postChangeWANVLAN()", + needreboot = true + }, { key = "aredn.olsr.restart", type = "none", @@ -234,7 +243,8 @@ local settings = { key = "aredn.@alerts[0].pollrate", type = "string", desc = "Specifies how many hours to wait between polling for new AREDN Alerts.", - default = "12" + default = "12", + needreboot = true }, { key = "aredn.aam.purge", @@ -446,6 +456,28 @@ function adjustTunnelInterfaceCount() end end +function postChangeWANVLAN() + local lines = {} + for line in io.lines("/etc/config.mesh/_setup") + do + if not line:match("^wan_intf = ") then + lines[#lines + 1] = line + end + end + if newval ~= "" then + lines[#lines + 1] = "wan_intf = " .. newval + end + local f = io.open("/etc/config.mesh/_setup", "w") + if f then + for _, line in ipairs(lines) + do + f:write(line .. "\n") + end + f:close() + end + os.execute("/usr/local/bin/node-setup -a mesh") +end + -- read_postdata local parms = {} if os.getenv("REQUEST_METHOD") == "POST" then @@ -496,6 +528,9 @@ do if setting.postcallback then loadstring(setting.postcallback)() end + if setting.needreboot then + io.open("/tmp/reboot-required", "w"):close() + end break end end @@ -605,6 +640,10 @@ html.print("") html.print("Help    ") +if nixio.fs.stat("/tmp/reboot-required") then + html.print("

Reboot is required for changes to take effect

") +end + for _, m in ipairs(msgs) do html.print("" .. m .. "") diff --git a/files/www/cgi-bin/setup b/files/www/cgi-bin/setup index f371fbef..1d453eed 100755 --- a/files/www/cgi-bin/setup +++ b/files/www/cgi-bin/setup @@ -1310,6 +1310,7 @@ html.print("NTP Server" +hidden[#hidden + 1] = "" for _,hid in ipairs(hidden) do