From 4d750aa8352bcd0131531c89b87c55e806e452c3 Mon Sep 17 00:00:00 2001 From: teastep Date: Thu, 30 Mar 2006 19:25:57 +0000 Subject: [PATCH] Minor cleanups git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3760 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/compiler | 26 +++++++++++++++----------- Shorewall/shorecap | 2 +- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Shorewall/compiler b/Shorewall/compiler index 5b15a9ffa..514fdeb4a 100755 --- a/Shorewall/compiler +++ b/Shorewall/compiler @@ -85,7 +85,7 @@ progress_message_and_save() } # -# Filter to indent the passed text by $INTENT +# Indent and echo the contents of the passed file by $INDENT # indent() { if [ -n "$INDENT" ]; then @@ -100,7 +100,7 @@ indent() { } # -# Append a file to the compiler's output +# Append a file to the compiler's output with indentation. # append_file() # $1 = File Name { @@ -691,24 +691,28 @@ iprange_echo() # get_set_flags() # $1 = set name and optional [levels], $2 = src or dst { - local temp setname=$1 options=$2 + # + # Note: There is a lot of unnecessary evaluation in this function just so my text + # editor doesn't get lost trying to follow the shell syntax for highlighting. + # + local temp setname=$1 options=$2 firstcase='*\[[1-6]\]' secondcase='*\[*\]' [ -n "$IPSET_MATCH" ] || fatal_error "Your kernel and/or iptables does not include ipset match: $1" case $1 in - *\[[1-6]\]) - temp=${1#*\[} - temp=${temp%\]} - setname=${1%\[*} + $firstcase) + eval temp='${1#*\[}' + eval temp='${temp%\]}' + eval setname='${1%\[*}' while [ $temp -gt 1 ]; do options="$options,$2" temp=$(($temp - 1)) done ;; - *\[*\]) - options=${1#*\[} - options=${options%\]} - setname=${1%\[*} + $secondcase) + eval options='${1#*\[}' + eval options='${options%\]}' + eval setname='${1%\[*}' ;; *) ;; diff --git a/Shorewall/shorecap b/Shorewall/shorecap index ef6eb68cb..997b97894 100755 --- a/Shorewall/shorecap +++ b/Shorewall/shorecap @@ -293,7 +293,7 @@ report_capability() # $1 = Capability report_capabilities() { echo "#" - echo "#Shorewall $VERSION detected the following iptables/netfilter capabilities - $(date)" + echo "# Shorewall $VERSION detected the following iptables/netfilter capabilities - $(date)" echo "#" report_capability NAT_ENABLED report_capability MANGLE_ENABLED