mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Keep route lines when editing an interface http://virtualmin.com/node/34470
This commit is contained in:
@@ -233,7 +233,9 @@ foreach $iface (@ifaces) {
|
||||
$found = 1;
|
||||
foreach my $o (@{$iface->[3]}) {
|
||||
if ($o->[0] eq 'gateway' ||
|
||||
$o->[0] eq 'pre-up' && $o->[1] =~ /brctl/) {
|
||||
$o->[0] eq 'pre-up' && $o->[1] =~ /brctl/ ||
|
||||
$o->[0] =~ /^(pre-)?up$/ &&
|
||||
$o->[1] =~ /ip\s+route/) {
|
||||
push(@options, $o);
|
||||
}
|
||||
}
|
||||
@@ -244,6 +246,9 @@ foreach $iface (@ifaces) {
|
||||
}
|
||||
}
|
||||
|
||||
# Remove any duplicate options
|
||||
@options = grep { !$done{$_->[0],$_->[1]}++ } @options;
|
||||
|
||||
if (!$found) {
|
||||
# Add a new interface section
|
||||
if ($in{'vlan'} == 1) {
|
||||
|
||||
Reference in New Issue
Block a user