mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-23 06:38:53 +01:00
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:
parent
12ac2a0ab6
commit
003a478220
@ -179,6 +179,16 @@ expand() # $@ = contents of variable which may be the name of another variable
|
||||
eval echo \"$@\"
|
||||
}
|
||||
|
||||
#
|
||||
# Filter that expands variables
|
||||
#
|
||||
expand_line() {
|
||||
local line
|
||||
|
||||
while read line; do
|
||||
echo $(expand $line)
|
||||
done
|
||||
}
|
||||
#
|
||||
# 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)"
|
||||
fi
|
||||
else
|
||||
echo "$(expand $first $rest)"
|
||||
echo "$first $rest"
|
||||
fi
|
||||
done < $1
|
||||
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
|
||||
|
||||
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
|
||||
> $TMP_DIR/$1
|
||||
fi
|
||||
|
@ -1,4 +1,4 @@
|
||||
!/bin/sh
|
||||
#!/bin/sh
|
||||
#
|
||||
# Shorewall Packet Filtering Firewall Control Program - V3.3
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user