mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-24 15:18:53 +01:00
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:
parent
992cc301a7
commit
2528043867
@ -1183,7 +1183,6 @@ stop_firewall() {
|
|||||||
iptables -A INPUT -i lo -j ACCEPT
|
iptables -A INPUT -i lo -j ACCEPT
|
||||||
iptables -A OUTPUT -o lo -j ACCEPT
|
iptables -A OUTPUT -o lo -j ACCEPT
|
||||||
|
|
||||||
|
|
||||||
for interface in `find_interfaces_by_option dhcp`; do
|
for interface in `find_interfaces_by_option dhcp`; do
|
||||||
iptables -A INPUT -p udp -i $interface --dport 67:68 -j ACCEPT
|
iptables -A INPUT -p udp -i $interface --dport 67:68 -j ACCEPT
|
||||||
iptables -A OUTPUT -p udp -o $interface --dport 67:68 -j ACCEPT
|
iptables -A OUTPUT -p udp -o $interface --dport 67:68 -j ACCEPT
|
||||||
|
@ -25,9 +25,22 @@ find_file()
|
|||||||
#
|
#
|
||||||
# Replace commas with spaces and echo the result
|
# Replace commas with spaces and echo the result
|
||||||
#
|
#
|
||||||
separate_list()
|
separate_list() {
|
||||||
{
|
local list
|
||||||
echo $1 | sed 's/,/ /g'
|
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user