forked from extern/shorewall_code
Don't emit 'enable' code for required providers
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
e1afc645ba
commit
fcb8fa79c0
@ -615,14 +615,15 @@ sub add_a_provider( $$ ) {
|
|||||||
emit $_ for @{$providers{$table}->{routes}};
|
emit $_ for @{$providers{$table}->{routes}};
|
||||||
}
|
}
|
||||||
|
|
||||||
emit( '',
|
emit( '' );
|
||||||
'if [ $COMMAND = enable ]; then'
|
|
||||||
);
|
|
||||||
|
|
||||||
push_indent;
|
|
||||||
|
|
||||||
my ( $tbl, $weight );
|
my ( $tbl, $weight );
|
||||||
|
|
||||||
|
if ( $optional ) {
|
||||||
|
emit( 'if [ $COMMAND = enable ]; then' );
|
||||||
|
|
||||||
|
push_indent;
|
||||||
|
|
||||||
if ( $balance || $default ) {
|
if ( $balance || $default ) {
|
||||||
$tbl = $default || $config{USE_DEFAULT_RT} ? DEFAULT_TABLE : MAIN_TABLE;
|
$tbl = $default || $config{USE_DEFAULT_RT} ? DEFAULT_TABLE : MAIN_TABLE;
|
||||||
$weight = $balance ? $balance : $default;
|
$weight = $balance ? $balance : $default;
|
||||||
@ -643,17 +644,14 @@ sub add_a_provider( $$ ) {
|
|||||||
|
|
||||||
pop_indent;
|
pop_indent;
|
||||||
|
|
||||||
emit( 'else' );
|
emit( 'else' ,
|
||||||
|
qq( echo $weight > \${VARDIR}/${physical}_weight) ,
|
||||||
if ( $optional ) {
|
qq( progress_message " Provider $table ($number) Started"),
|
||||||
emit " echo $weight > \${VARDIR}/${physical}_weight";
|
qq(fi\n)
|
||||||
} else {
|
|
||||||
emit " rm -f \${VARDIR}/${physical}_weight";
|
|
||||||
}
|
|
||||||
|
|
||||||
emit( " progress_message " Provider $table ($number) Started"",
|
|
||||||
"fi\n"
|
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
emit( qq(progress_message "Provider $table ($number) Started") );
|
||||||
|
}
|
||||||
|
|
||||||
pop_indent;
|
pop_indent;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user