Don't indent the embedded scfilter file.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-10-01 13:20:36 -07:00
parent 5b86cbdabf
commit b27fd07e9f
2 changed files with 10 additions and 4 deletions

View File

@ -354,7 +354,7 @@ sub generate_script_3($) {
if ( -f $fn ) {
emit( '',
'cat << __EOF__ > ${VARDIR}/scfilter' );
append_file $fn,1 or emit 'cat -';
append_file( $fn,1,1 ) or emit_unindented "#! /bin/sh\ncat -";
emit_unindented( "__EOF__\n" );
}
} else {

View File

@ -3277,13 +3277,17 @@ sub propagateconfig() {
# Add a shell script file to the output script -- Return true if the
# file exists and is not in /usr/share/shorewall/ and is non-empty.
#
sub append_file( $;$ ) {
my $user_exit = find_file $_[0];
sub append_file( $;$$ ) {
my ( $file, $nomsg, $unindented ) = @_;
my $user_exit = find_file $file;
my $result = 0;
my $save_indent = $indent;
$indent = '' if $unindented;
unless ( $user_exit =~ /^($globals{SHAREDIR})/ ) {
if ( -f $user_exit ) {
if ( $_[1] ) {
if ( $nomsg ) {
#
# Suppress progress message
#
@ -3299,6 +3303,8 @@ sub append_file( $;$ ) {
}
}
$indent = $save_indent;
$result;
}