1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

[package] firewall: revert accidential committed changes from r26805

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26806 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow
2011-05-02 12:55:36 +00:00
parent 667c11ec82
commit 864e3ef263

View File

@@ -1,55 +1,27 @@
# Copyright (C) 2009-2011 OpenWrt.org # Copyright (C) 2009-2010 OpenWrt.org
fw__uci_state_add() { fw__uci_state_add() {
local var="$1" local var="$1"
local item="$2" local item="$2"
local list="$(uci_get_state firewall core $var)" local val=" $(uci_get_state firewall core $var) "
list=" ${list:+$list }" val="${val// $item / }"
val="${val# }"
for item in $item; do val="${val% }"
case "$list" in
"* $item *") continue;;
*) list="$list$item ";;
esac
done
list="${list% }"
list="${list# }"
uci_revert_state firewall core $var uci_revert_state firewall core $var
uci_set_state firewall core $var "$list" uci_set_state firewall core $var "${val:+$val }$item"
} }
fw__uci_state_del() { fw__uci_state_del() {
local var="$1" local var="$1"
local item="$2" local item="$2"
echo "del[$item]" local val=" $(uci_get_state firewall core $var) "
val="${val// $item / }"
local list val val="${val# }"
for val in $(uci_get_state firewall core "$var" | sort -u); do val="${val% }"
list="${list:+$list }$val"
done
echo "list[$list]"
uci_revert_state firewall core $var uci_revert_state firewall core $var
uci_set_state firewall core $var "$val"
[ -n "$list" ] && {
list=" $list "
for item in $item; do
list="${list// $item / }"
done
list="${list# }"
list="${list% }"
echo "list2[$list]"
uci_set_state firewall core $var "$list"
}
} }
fw_configure_interface() { fw_configure_interface() {