forked from extern/shorewall_code
Have separate hashes for the two shorewallrc files.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
55e3b11a28
commit
bdd66e68c9
@ -158,7 +158,7 @@ sub generate_script_2() {
|
|||||||
|
|
||||||
push_indent;
|
push_indent;
|
||||||
|
|
||||||
if ( $shorewallrc{TEMPDIR} ) {
|
if ( $shorewallrc1{TEMPDIR} ) {
|
||||||
emit( '',
|
emit( '',
|
||||||
qq(TMPDIR="$shorewallrc{TEMPDIR}") ,
|
qq(TMPDIR="$shorewallrc{TEMPDIR}") ,
|
||||||
q(export TMPDIR) );
|
q(export TMPDIR) );
|
||||||
@ -168,14 +168,14 @@ sub generate_script_2() {
|
|||||||
emit( 'g_family=4' );
|
emit( 'g_family=4' );
|
||||||
|
|
||||||
if ( $export ) {
|
if ( $export ) {
|
||||||
emit ( qq(g_confdir=$shorewallrc{CONFDIR}/shorewall-lite),
|
emit ( qq(g_confdir=$shorewallrc1{CONFDIR}/shorewall-lite),
|
||||||
'g_product="Shorewall Lite"',
|
'g_product="Shorewall Lite"',
|
||||||
'g_program=shorewall-lite',
|
'g_program=shorewall-lite',
|
||||||
'g_basedir=/usr/share/shorewall-lite',
|
'g_basedir=/usr/share/shorewall-lite',
|
||||||
qq(CONFIG_PATH="$shorewallrc{CONFDIR}/shorewall-lite:$shorewallrc{SHAREDIR}/shorewall-lite") ,
|
qq(CONFIG_PATH="$shorewallrc1{CONFDIR}/shorewall-lite:$shorewallrc1{SHAREDIR}/shorewall-lite") ,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
emit ( qq(g_confdir=$shorewallrc{CONFDIR}/shorewall),
|
emit ( qq(g_confdir=$shorewallrc1{CONFDIR}/shorewall),
|
||||||
'g_product=Shorewall',
|
'g_product=Shorewall',
|
||||||
'g_program=shorewall',
|
'g_program=shorewall',
|
||||||
'g_basedir=/usr/share/shorewall',
|
'g_basedir=/usr/share/shorewall',
|
||||||
@ -186,14 +186,14 @@ sub generate_script_2() {
|
|||||||
emit( 'g_family=6' );
|
emit( 'g_family=6' );
|
||||||
|
|
||||||
if ( $export ) {
|
if ( $export ) {
|
||||||
emit ( qq(g_confdir=$shorewallrc{CONFDIR}/shorewall6-lite),
|
emit ( qq(g_confdir=$shorewallrc1{CONFDIR}/shorewall6-lite),
|
||||||
'g_product="Shorewall6 Lite"',
|
'g_product="Shorewall6 Lite"',
|
||||||
'g_program=shorewall6-lite',
|
'g_program=shorewall6-lite',
|
||||||
'g_basedir=/usr/share/shorewall6',
|
'g_basedir=/usr/share/shorewall6',
|
||||||
qq(CONFIG_PATH="$shorewallrc{CONFDIR}/shorewall6-lite:$shorewallrc{SHAREDIR}/shorewall6-lite") ,
|
qq(CONFIG_PATH="$shorewallrc1{CONFDIR}/shorewall6-lite:$shorewallrc{SHAREDIR}/shorewall6-lite") ,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
emit ( qq(g_confdir=$shorewallrc{CONFDIR}/shorewall6),
|
emit ( qq(g_confdir=$shorewallrc1{CONFDIR}/shorewall6),
|
||||||
'g_product=Shorewall6',
|
'g_product=Shorewall6',
|
||||||
'g_program=shorewall6',
|
'g_program=shorewall6',
|
||||||
'g_basedir=/usr/share/shorewall',
|
'g_basedir=/usr/share/shorewall',
|
||||||
@ -206,15 +206,15 @@ sub generate_script_2() {
|
|||||||
|
|
||||||
if ( $family == F_IPV4 ) {
|
if ( $family == F_IPV4 ) {
|
||||||
if ( $export ) {
|
if ( $export ) {
|
||||||
emit ( '[ -n "${VARDIR:=' . $shorewallrc{VARDIR} . '/shorewall-lite}" ]' );
|
emit ( '[ -n "${VARDIR:=' . $shorewallrc1{VARDIR} . '/shorewall-lite}" ]' );
|
||||||
} else {
|
} else {
|
||||||
emit ( '[ -n "${VARDIR:=' . $shorewallrc{VARDIR} . '/shorewall}" ]' );
|
emit ( '[ -n "${VARDIR:=' . $shorewallrc1{VARDIR} . '/shorewall}" ]' );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ( $export ) {
|
if ( $export ) {
|
||||||
emit ( '[ -n "${VARDIR:=' . $shorewallrc{VARDIR} . '/shorewall6-lite}" ]' );
|
emit ( '[ -n "${VARDIR:=' . $shorewallrc1{VARDIR} . '/shorewall6-lite}" ]' );
|
||||||
} else {
|
} else {
|
||||||
emit ( '[ -n "${VARDIR:=' . $shorewallrc{VARDIR} . '/shorewall6}" ]' );
|
emit ( '[ -n "${VARDIR:=' . $shorewallrc1{VARDIR} . '/shorewall6}" ]' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,6 +144,7 @@ our %EXPORT_TAGS = ( internal => [ qw( create_temp_script
|
|||||||
%globals
|
%globals
|
||||||
%config_files
|
%config_files
|
||||||
%shorewallrc
|
%shorewallrc
|
||||||
|
%shorewallrc1
|
||||||
|
|
||||||
%helpers
|
%helpers
|
||||||
%helpers_map
|
%helpers_map
|
||||||
@ -540,7 +541,7 @@ my $ifstack;
|
|||||||
#
|
#
|
||||||
# From .shorewallrc
|
# From .shorewallrc
|
||||||
#
|
#
|
||||||
our %shorewallrc;
|
our ( %shorewallrc, %shorewallrc1 );
|
||||||
#
|
#
|
||||||
# read_a_line options
|
# read_a_line options
|
||||||
#
|
#
|
||||||
@ -900,6 +901,11 @@ sub initialize( $;$$) {
|
|||||||
SHAREDIR => '/usr/share/',
|
SHAREDIR => '/usr/share/',
|
||||||
CONFDIR => '/etc/',
|
CONFDIR => '/etc/',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
%shorewallrc1 = (
|
||||||
|
SHAREDIR => '/usr/share/',
|
||||||
|
CONFDIR => '/etc/',
|
||||||
|
);
|
||||||
|
|
||||||
%helpers_enabled = (
|
%helpers_enabled = (
|
||||||
amanda => 1,
|
amanda => 1,
|
||||||
@ -968,7 +974,15 @@ sub initialize( $;$$) {
|
|||||||
#
|
#
|
||||||
# If we are compiling for export, process the shorewallrc from the remote system
|
# If we are compiling for export, process the shorewallrc from the remote system
|
||||||
#
|
#
|
||||||
process_shorewallrc( $shorewallrc1 ) if $shorewallrc1;
|
if ( $shorewallrc1 ) {
|
||||||
|
my %rc = %shorewallrc;
|
||||||
|
%shorewallrc = ( );
|
||||||
|
process_shorewallrc( $shorewallrc1 );
|
||||||
|
%shorewallrc1 = %shorewallrc;
|
||||||
|
%shorewallrc = %rc;
|
||||||
|
} else {
|
||||||
|
%shorewallrc1 = %shorewallrc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
|
my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
# See http://shorewall.net/starting_and_stopping_shorewall.htm for additional
|
# See http://shorewall.net/starting_and_stopping_shorewall.htm for additional
|
||||||
# information.
|
# information.
|
||||||
#
|
#
|
||||||
FORMAT 2
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#TARGET SOURCE DEST PROTO DEST SOURCE
|
#TARGET SOURCE DEST PROTO DEST SOURCE
|
||||||
# PORT(S) PORT(S)
|
# PORT(S) PORT(S)
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
# See http://shorewall.net/starting_and_stopping_shorewall.htm for additional
|
# See http://shorewall.net/starting_and_stopping_shorewall.htm for additional
|
||||||
# information.
|
# information.
|
||||||
#
|
#
|
||||||
FORMAT 2
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#TARGET SOURCE DEST PROTO DEST SOURCE
|
#TARGET SOURCE DEST PROTO DEST SOURCE
|
||||||
# PORT(S) PORT(S)
|
# PORT(S) PORT(S)
|
||||||
|
Loading…
Reference in New Issue
Block a user