De-dup dmz_mode (was being stored in two places) (#1656)

This commit is contained in:
Tim Wilkinson 2024-10-27 21:29:29 -07:00 committed by GitHub
parent f153b79e05
commit e49dd7e73c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 6 deletions

View File

@ -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",

View File

@ -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")

View File

@ -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