mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
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:
@@ -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:");
|
||||
|
||||
Reference in New Issue
Block a user