mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-15 04:04:10 +01:00
Allow a provider name in addition to an interface name in enable/disable
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
3110f7c74a
commit
8f14485d67
@ -780,7 +780,7 @@ sub add_a_provider( $$ ) {
|
||||
"qt \$TC qdisc del dev $physical root",
|
||||
"qt \$TC qdisc del dev $physical ingress\n" ) if $tcdevices->{$interface};
|
||||
|
||||
emit( "progress_message2 \"Provider $table stopped\"" );
|
||||
emit( "progress_message2 \" Provider $table ($number) stopped\"" );
|
||||
|
||||
pop_indent;
|
||||
|
||||
@ -1125,14 +1125,21 @@ EOF
|
||||
for my $provider (@providers ) {
|
||||
my $providerref = $providers{$provider};
|
||||
|
||||
emit( "$providerref->{physical})",
|
||||
" if [ -z \"`\$IP -$family route ls table $providerref->{number}`\" ]; then",
|
||||
" start_provider_$provider",
|
||||
' else',
|
||||
' startup_error "Interface $g_interface is already enabled"',
|
||||
' fi',
|
||||
' ;;'
|
||||
) if $providerref->{optional};
|
||||
if ( $providerref->{optional} ) {
|
||||
if ( $providerref->{shared} || $providerref->{physical} eq $provider) {
|
||||
emit "$provider})";
|
||||
} else {
|
||||
emit( "$providerref->{physical}|$provider)" );
|
||||
}
|
||||
|
||||
emit ( " if [ -z \"`\$IP -$family route ls table $providerref->{number}`\" ]; then",
|
||||
" start_provider_$provider",
|
||||
' else',
|
||||
' startup_error "Interface $g_interface is already enabled"',
|
||||
' fi',
|
||||
' ;;'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pop_indent;
|
||||
@ -1140,7 +1147,7 @@ EOF
|
||||
|
||||
emit << 'EOF';;
|
||||
*)
|
||||
startup_error "$g_interface is not an optional provider interface"
|
||||
startup_error "$g_interface is not an optional provider or provider interface"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user