Keep route lines when editing an interface http://virtualmin.com/node/34470

This commit is contained in:
Jamie Cameron
2014-10-10 17:29:04 -07:00
parent 84c0756f39
commit 359297fa01

View File

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