diff --git a/Shorewall-perl/Shorewall/Chains.pm b/Shorewall-perl/Shorewall/Chains.pm index 01592aaea..e990a4eee 100644 --- a/Shorewall-perl/Shorewall/Chains.pm +++ b/Shorewall-perl/Shorewall/Chains.pm @@ -2462,6 +2462,7 @@ sub create_netfilter_load() { push_indent; my $utility = $family == F_IPV4 ? 'iptables-restore' : 'ip6tables-restore'; + my $UTILITY = $family == F_IPV4 ? 'IPTABLES_RESTORE' : 'IP6TABLES_RESTORE'; save_progress_message "Preparing $utility input..."; @@ -2516,7 +2517,7 @@ sub create_netfilter_load() { # emit( 'exec 3>&-', '', - '[ -n "$DEBUG" ] && command=debug_restore_input || command=$IPTABLES_RESTORE', + '[ -n "$DEBUG" ] && command=debug_restore_input || command=$' . $UTILITY, '', 'progress_message2 "Running $command..."', '', diff --git a/Shorewall-perl/Shorewall/Compiler.pm b/Shorewall-perl/Shorewall/Compiler.pm index f96ec1bf8..5b4602592 100644 --- a/Shorewall-perl/Shorewall/Compiler.pm +++ b/Shorewall-perl/Shorewall/Compiler.pm @@ -134,12 +134,22 @@ sub generate_script_1() { emit( '[ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir' ); - if ( $export ) { - emit ( 'CONFIG_PATH="/etc/shorewall-lite:/usr/share/shorewall-lite"' , - '[ -n "${VARDIR:=/var/lib/shorewall-lite}" ]' ); + if ( $family == F_IPV4 ) { + if ( $export ) { + emit ( 'CONFIG_PATH="/etc/shorewall-lite:/usr/share/shorewall-lite"' , + '[ -n "${VARDIR:=/var/lib/shorewall-lite}" ]' ); + } else { + emit ( qq(CONFIG_PATH="$config{CONFIG_PATH}") , + '[ -n "${VARDIR:=/var/lib/shorewall}" ]' ); + } } else { - emit ( qq(CONFIG_PATH="$config{CONFIG_PATH}") , - '[ -n "${VARDIR:=/var/lib/shorewall}" ]' ); + if ( $export ) { + emit ( 'CONFIG_PATH="/etc/shorewall6-lite:/usr/share/shorewall6-lite"' , + '[ -n "${VARDIR:=/var/lib/shorewall6-lite}" ]' ); + } else { + emit ( qq(CONFIG_PATH="$config{CONFIG_PATH}") , + '[ -n "${VARDIR:=/var/lib/shorewall6}" ]' ); + } } emit 'TEMPFILE='; diff --git a/Shorewall-perl/Shorewall/Config.pm b/Shorewall-perl/Shorewall/Config.pm index 5f7d173c3..571cece2d 100644 --- a/Shorewall-perl/Shorewall/Config.pm +++ b/Shorewall-perl/Shorewall/Config.pm @@ -2341,7 +2341,7 @@ sub generate_aux_config() { my $value = $config{$option}; - emit "[ -n \"\${$option:=$value}\" ]" if $value ne ''; + emit "[ -n \"\${$option:=$value}\" ]" if defined $value && $value ne ''; } sub conditionally_add_option1( $ ) {