mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-01 23:45:53 +02:00
More rational approach to leading '+' removal
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6351 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
5b3e741aa3
commit
37a5edb43a
@ -46,7 +46,7 @@ add_to_zone() # $1...${n-1} = <interface>[:<hosts>] $n = zone
|
|||||||
[ -n "$IPRANGE_MATCH" ] && [ -f $TMP_DIR/iprange ] && rm -f $TMP_DIR/iprange
|
[ -n "$IPRANGE_MATCH" ] && [ -f $TMP_DIR/iprange ] && rm -f $TMP_DIR/iprange
|
||||||
|
|
||||||
if ! $IPTABLES $@ ; then
|
if ! $IPTABLES $@ ; then
|
||||||
error_message "ERROR: Can't add ${newhost#+} to zone $zone"
|
error_message "ERROR: Can't add $newhost to zone $zone"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,11 +154,11 @@ add_to_zone() # $1...${n-1} = <interface>[:<hosts>] $n = zone
|
|||||||
# Create a new Zone state file
|
# Create a new Zone state file
|
||||||
#
|
#
|
||||||
for newhost in $newhostlist; do
|
for newhost in $newhostlist; do
|
||||||
|
newhost=${newhost#+}
|
||||||
#
|
#
|
||||||
# Isolate interface and host parts
|
# Isolate interface and host parts
|
||||||
#
|
#
|
||||||
interface=${newhost%%:*}
|
interface=${newhost%%:*}
|
||||||
interface=${interface#+}
|
|
||||||
host=${newhost#*:}
|
host=${newhost#*:}
|
||||||
#
|
#
|
||||||
# If the zone passed in the command has a dnat chain then insert a rule in
|
# If the zone passed in the command has a dnat chain then insert a rule in
|
||||||
@ -220,7 +220,7 @@ add_to_zone() # $1...${n-1} = <interface>[:<hosts>] $n = zone
|
|||||||
fi
|
fi
|
||||||
done < ${VARDIR}/chains
|
done < ${VARDIR}/chains
|
||||||
|
|
||||||
progress_message "${newhost#+} added to zone $zone"
|
progress_message "$newhost added to zone $zone"
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user