Implement SW_CONFDIR support

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2018-11-06 15:40:26 -08:00
parent 6534201284
commit 03d2088cf7
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10
2 changed files with 11 additions and 1 deletions

View File

@ -5925,7 +5925,7 @@ sub get_params( $ ) {
#
delete $params{$_};
} else {
unless ( $_ eq 'SHOREWALL_INIT_SCRIPT' || $_ eq 'SW_LOGGERTAG' ) {
unless ( $_ eq 'SHOREWALL_INIT_SCRIPT' || $_ eq 'SW_LOGGERTAG' || $_ eq 'SW_CONFDIR' ) {
fatal_error "The variable name $_ is reserved and may not be set in the params file"
if /^SW_/ || /^SHOREWALL_/ || ( exists $config{$_} && ! exists $ENV{$_} ) || exists $reserved{$_};
}

View File

@ -456,6 +456,16 @@ compiler() {
ensure_root
#
# Let params and the compiler know the base configuration directory
#
if [ -n "$g_shorewalldir" ]; then
SW_CONFDIR="$g_shorewalldir"
else
SW_CONFDIR="$g_confdir"
fi
export SW_CONFDIR
#
# We've now set g_shorewalldir so recalculate CONFIG_PATH
#
[ -n "$g_haveconfig" ] || ensure_config_path