Reduce stale management VLAN entries on config save

The firmware has a single management VLAN (one management_vlan variable),
so a stored config should never carry more than one "vlan N mgmt" line.
When parsing a mgmt command, drop any previously stored mgmt entry so
repeatedly changing the management VLAN no longer accumulates stale lines.
This commit is contained in:
Erdnusschokolade
2026-06-20 08:00:54 +02:00
parent 06ee1ce38e
commit 718745e7b5
+3
View File
@@ -77,6 +77,9 @@ function parseConf(s){
break;
}
}
// Only one management VLAN can be active, so drop any previous mgmt entry
if (/^vlan\s+\d{1,4}\s+mgmt$/.test(line))
configuration = configuration.filter(item => !/^vlan\s+\d{1,4}\s+mgmt$/.test(item));
configuration.push(line);
}
console.log("Configuration now:");