mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-24 07:08:53 +01:00
Only initialize switches that survived optimization
- Also use push_indent to make things more readable Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
7d4bc568d8
commit
e60369728a
@ -7488,13 +7488,16 @@ sub create_stop_load( $ ) {
|
||||
sub initialize_switches() {
|
||||
unless ( have_capability 'CONDITION_INIT' ) {
|
||||
if ( keys %switches ) {
|
||||
emit( ' if [ $COMMAND = start ]; then' );
|
||||
push_indent; push_indent;
|
||||
emit( 'if [ $COMMAND = start ]; then' );
|
||||
push_indent;
|
||||
while ( my ( $switch, $setting ) = each %switches ) {
|
||||
emit " echo $setting->{setting} > /proc/net/nf_condition/$switch";
|
||||
my $file = "/proc/net/nf_condition/$switch";
|
||||
emit "[ -f $file ] && echo $setting->{setting} > $file";
|
||||
}
|
||||
pop_indent;
|
||||
emit " fi\n";
|
||||
emit "fi\n";
|
||||
pop_indent; pop_indent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user