From fd1d6cf935f6221af62239b6bf5b97d8c6d38637 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 7 May 2012 16:55:17 -0700 Subject: [PATCH] Handle default shorewallrc location Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Config.pm | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index f3c8785eb..0826af592 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -782,23 +782,21 @@ sub initialize( $;$ ) { CONFDIR => '/etc/', ); - if ( $shorewallrc ) { - process_shorewallrc( $shorewallrc ); + process_shorewallrc( $shorewallrc ) if $shorewallrc; - $globals{SHAREDIRPL} = "$shorewallrc{SHAREDIR}/shorewall/"; + $globals{SHAREDIRPL} = "$shorewallrc{SHAREDIR}/shorewall/"; - if ( $family == F_IPV4 ) { - $globals{SHAREDIR} = "$shorewallrc{SHAREDIR}/shorewall"; - $globals{CONFDIR} = "$shorewallrc{CONFDIR}/shorewall"; - $globals{PRODUCT} = 'shorewall'; - $config{IPTABLES} = undef; - $validlevels{ULOG} = 'ULOG'; - } else { - $globals{SHAREDIR} = "$shorewallrc{SHAREDIR}/shorewall6"; - $globals{CONFDIR} = "$shorewallrc{CONFDIR}/shorewall6"; - $globals{PRODUCT} = 'shorewall6'; - $config{IP6TABLES} = undef; - } + if ( $family == F_IPV4 ) { + $globals{SHAREDIR} = "$shorewallrc{SHAREDIR}/shorewall"; + $globals{CONFDIR} = "$shorewallrc{CONFDIR}/shorewall"; + $globals{PRODUCT} = 'shorewall'; + $config{IPTABLES} = undef; + $validlevels{ULOG} = 'ULOG'; + } else { + $globals{SHAREDIR} = "$shorewallrc{SHAREDIR}/shorewall6"; + $globals{CONFDIR} = "$shorewallrc{CONFDIR}/shorewall6"; + $globals{PRODUCT} = 'shorewall6'; + $config{IP6TABLES} = undef; } }