mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-22 21:48:39 +01:00
Emit more compact code when conditionally adding DOCKER chains
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
36b6863b02
commit
49536562e2
@ -8472,9 +8472,7 @@ sub create_netfilter_load( $ ) {
|
||||
assert( $chainref->{cmdlevel} == 0 , $name );
|
||||
if ( $name eq 'DOCKER' ) {
|
||||
enter_cmd_mode;
|
||||
emit( 'if [ -n "$g_docker" ]; then',
|
||||
' echo ":DOCKER - [0:0]" >&3',
|
||||
'fi' );
|
||||
emit( '[ -n "$g_docker" ] && echo ":DOCKER - [0:0]" >&3' );
|
||||
enter_cat_mode;
|
||||
} else {
|
||||
emit_unindented ":$name - [0:0]";
|
||||
@ -8569,9 +8567,7 @@ sub preview_netfilter_load() {
|
||||
assert( $chainref->{cmdlevel} == 0 , $name );
|
||||
if ( $name eq 'DOCKER' ) {
|
||||
enter_cmd_mode;
|
||||
emit( 'if [ -n "$g_docker" ]; then',
|
||||
' echo ":DOCKER - [0:0]" >&3',
|
||||
'fi' );
|
||||
emit( '[ -n "$g_docker" ] && echo ":DOCKER - [0:0]" >&3' );
|
||||
enter_cat_mode;
|
||||
} else {
|
||||
emit_unindented ":$name - [0:0]";
|
||||
@ -8799,9 +8795,7 @@ sub create_stop_load( $ ) {
|
||||
assert( $chainref->{cmdlevel} == 0 , $name );
|
||||
if ( $name eq 'DOCKER' ) {
|
||||
enter_cmd_mode;
|
||||
emit( 'if [ -n "$g_docker" ]; then',
|
||||
' echo ":DOCKER - [0:0]" >&3',
|
||||
'fi' );
|
||||
emit( '[ -n "$g_docker" ] && echo ":DOCKER - [0:0]" >&3' );
|
||||
enter_cat_mode;
|
||||
} else {
|
||||
emit_unindented ":$name - [0:0]";
|
||||
|
Loading…
Reference in New Issue
Block a user