Implement undocumented dumpfilter extension file

This commit is contained in:
Tom Eastep 2010-10-07 14:19:09 -07:00
parent f0ef27b3e5
commit 033d43b014
3 changed files with 81 additions and 2 deletions

View File

@ -3437,6 +3437,17 @@ sub generate_aux_config() {
emit '}';
}
my $fn = find_file 'dumpfilter';
if ( -f $fn ) {
emit( '',
'dump_filter() {' );
push_indent;
append_file( $fn,1 ) or emit 'cat -';
pop_indent;
emit '}';
}
finalize_aux_config;
}

View File

@ -811,10 +811,40 @@ show_command() {
esac
}
#
# Dump Filter - For Shorewall-lite, if there was a dumpfilter file at compile-time,
# then the compiler generated another version of this function and
# embedded it in the firewall.conf file. That version supersedes this
# one.
#
dump_filter() {
local filter
local command
local first
command=${SHOREWALL_SHELL}
filter=$(find_file dumpfilter)
if [ -f $filter ]; then
first=$(head -n1 $filter)
case $first in
\#!*)
command=${first#\#!}
;;
esac
$command $filter
else
cat -
fi
}
#
# Dump Command Executor
#
dump_command() {
do_dump_command() {
local finished
finished=0
@ -1068,6 +1098,10 @@ read_yesno_with_timeout() {
fi
}
dump_command() {
do_dump_command | dump_filter
}
#
# Print a heading with leading and trailing black lines
#

View File

@ -686,10 +686,40 @@ show_command() {
esac
}
#
# Dump Filter - For Shorewall-lite, if there was a dumpfilter file at compile-time,
# then the compiler generated another version of this function and
# embedded it in the firewall.conf file. That version supersedes this
# one.
#
dump_filter() {
local filter
local command
local first
command=${SHOREWALL_SHELL}
filter=$(find_file dumpfilter)
if [ -f $filter ]; then
first=$(head -n1 $filter)
case $first in
\#!*)
command=${first#\#!}
;;
esac
$command $filter
else
cat -
fi
}
#
# Dump Command Executor
#
dump_command() {
do_dump_command() {
local finished
finished=0
@ -833,6 +863,10 @@ dump_command() {
fi
}
dump_command() {
do_dump_command | dump_filter
}
#
# Restore Comand Executor
#