From 0e1e38b0356480a6bfa1ca8fbdda72ff36f274b8 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sun, 9 Sep 2012 13:12:32 -0700 Subject: [PATCH] Adjust VARDIR/VARLIB for old shorewallrc files. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Config.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 8edba2f6a..bc8ac7657 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -2645,6 +2645,15 @@ sub process_shorewallrc( $$ ) { } else { fatal_error "Failed to open $shorewallrc: $!"; } + + if ( supplied $shorewallrc{VARDIR} ) { + if ( ! supplied $shorewallrc{VARLIB} ) { + $shorewallrc{VARLIB} = $shorewallrc{VARDIR}; + $shorewallrc{VARDIR} = "$shorewallrc{VARLIB}/$product"; + } + } elsif ( supplied $shorewallrc{VARLIB} ) { + $shorewallrc{VARDIR} = "$shorewallrc{VARLIB}/$product" unless supplied $shorewallrc{VARDIR}; + } } #