mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-20 09:47:51 +02:00
Minor cleanups
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3760 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
704b0373c9
commit
4d750aa835
@ -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() {
|
indent() {
|
||||||
if [ -n "$INDENT" ]; then
|
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
|
append_file() # $1 = File Name
|
||||||
{
|
{
|
||||||
@ -691,24 +691,28 @@ iprange_echo()
|
|||||||
#
|
#
|
||||||
get_set_flags() # $1 = set name and optional [levels], $2 = src or dst
|
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"
|
[ -n "$IPSET_MATCH" ] || fatal_error "Your kernel and/or iptables does not include ipset match: $1"
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
*\[[1-6]\])
|
$firstcase)
|
||||||
temp=${1#*\[}
|
eval temp='${1#*\[}'
|
||||||
temp=${temp%\]}
|
eval temp='${temp%\]}'
|
||||||
setname=${1%\[*}
|
eval setname='${1%\[*}'
|
||||||
while [ $temp -gt 1 ]; do
|
while [ $temp -gt 1 ]; do
|
||||||
options="$options,$2"
|
options="$options,$2"
|
||||||
temp=$(($temp - 1))
|
temp=$(($temp - 1))
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
*\[*\])
|
$secondcase)
|
||||||
options=${1#*\[}
|
eval options='${1#*\[}'
|
||||||
options=${options%\]}
|
eval options='${options%\]}'
|
||||||
setname=${1%\[*}
|
eval setname='${1%\[*}'
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user