Speed up 'separate_list'

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@354 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2002-12-06 00:31:49 +00:00
parent 992cc301a7
commit 2528043867
2 changed files with 16 additions and 4 deletions

View File

@ -1183,7 +1183,6 @@ stop_firewall() {
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
for interface in `find_interfaces_by_option dhcp`; do
iptables -A INPUT -p udp -i $interface --dport 67:68 -j ACCEPT
iptables -A OUTPUT -p udp -o $interface --dport 67:68 -j ACCEPT

View File

@ -25,9 +25,22 @@ find_file()
#
# Replace commas with spaces and echo the result
#
separate_list()
{
echo $1 | sed 's/,/ /g'
separate_list() {
local list
local part
local newlist
list="$@"
part="${list%%,*}"
newlist="$part"
while [ "x$part" != "x$list" ]; do
list="${list#*,}";
part="${list%%,*}";
newlist="$newlist $part";
done
echo "$newlist"
}
#