Fixes for new preprocessing

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5075 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2006-12-10 03:01:24 +00:00
parent 12ac2a0ab6
commit 003a478220
2 changed files with 13 additions and 3 deletions

View File

@ -179,6 +179,16 @@ expand() # $@ = contents of variable which may be the name of another variable
eval echo \"$@\" eval echo \"$@\"
} }
#
# Filter that expands variables
#
expand_line() {
local line
while read line; do
echo $(expand $line)
done
}
# #
# Add whitespace after leading "!" # Add whitespace after leading "!"
# #
@ -1565,7 +1575,7 @@ read_file() # $1 = file name, $2 = nest count
error_message "WARNING: INCLUDE in $1 ignored (nested too deeply)" error_message "WARNING: INCLUDE in $1 ignored (nested too deeply)"
fi fi
else else
echo "$(expand $first $rest)" echo "$first $rest"
fi fi
done < $1 done < $1
else else
@ -1593,7 +1603,7 @@ strip_file() # $1 = Base Name of the file, $2 = Full Name of File (optional)
[ $# = 1 ] && fname=$(find_file $1) || fname=$2 [ $# = 1 ] && fname=$(find_file $1) || fname=$2
if [ -f $fname ]; then if [ -f $fname ]; then
read_file $fname 0 | cut -d'#' -f1 | grep -v '^[[:space:]]*$' > $TMP_DIR/$1 read_file $fname 0 | cut -d'#' -f1 | grep -v '^[[:space:]]*$' | expand_line > $TMP_DIR/$1
else else
> $TMP_DIR/$1 > $TMP_DIR/$1
fi fi

View File

@ -1,4 +1,4 @@
!/bin/sh #!/bin/sh
# #
# Shorewall Packet Filtering Firewall Control Program - V3.3 # Shorewall Packet Filtering Firewall Control Program - V3.3
# #