mirror of https://github.com/aredn/aredn.git
De-dup dmz_mode (was being stored in two places) (#1656)
This commit is contained in:
parent
f153b79e05
commit
e49dd7e73c
|
@ -58,9 +58,7 @@ end
|
|||
local config = {
|
||||
aredn = {
|
||||
alerts = {},
|
||||
dmz = {
|
||||
mode = shell("cat /etc/config/dmz-mode 2>/dev/null; rm -f /etc/config/dmz-mode") or 0
|
||||
},
|
||||
dmz = DELETE,
|
||||
downloads = {
|
||||
firmware_aredn = "http://downloads.arednmesh.org",
|
||||
packages_default = "http://downloads.arednmesh.org",
|
||||
|
|
|
@ -66,7 +66,7 @@ local function get(validate)
|
|||
names[#names + 1] = name
|
||||
end
|
||||
|
||||
local dmz_mode = uci.cursor("/etc/config.mesh"):get("aredn", "@dmz[0]", "mode")
|
||||
local dmz_mode = uci.cursor("/etc/config.mesh"):get("setup", "globals", "dmz_mode")
|
||||
if dmz_mode ~= "0" then
|
||||
if nixio.fs.stat("/etc/config.mesh/aliases.dmz") then
|
||||
for line in io.lines("/etc/config.mesh/aliases.dmz")
|
||||
|
|
|
@ -1307,7 +1307,7 @@ end
|
|||
|
||||
-- Handle special cases
|
||||
local config_special = {
|
||||
dmz_mode = c:get("aredn", "@dmz[0]", "mode"),
|
||||
dmz_mode = c:get("setup", "globals", "dmz_mode"),
|
||||
lqm_enable = c:get("aredn", "@lqm[0]", "enable"),
|
||||
tunnel_weight = c:get("aredn", "@tunnel[0]", "weight"),
|
||||
supernode_enable = c:get("aredn", "@supernode[0]", "enable"),
|
||||
|
@ -1354,7 +1354,7 @@ do
|
|||
changes.ntp = true
|
||||
elseif file == "aredn" then
|
||||
local oc = uci:cursor()
|
||||
if oc:get("aredn", "@dmz[0]", "mode") ~= config_special.dmz_mode then
|
||||
if oc:get("setup", "globals", "dmz_mode") ~= config_special.dmz_mode then
|
||||
changes.reboot = true
|
||||
end
|
||||
if oc:get("aredn", "@lqm[0]", "enable") ~= config_special.lqm_enable then
|
||||
|
|
Loading…
Reference in New Issue