aboutsummaryrefslogtreecommitdiffstats
path: root/package/firewall
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-05-02 12:55:36 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-05-02 12:55:36 +0000
commit5cc94f2ac693c6e4ba118aef880a66d813ad6390 (patch)
tree1548a7f9da0de0434f1afc96c2b188414357565c /package/firewall
parent244b5fcbdb2795a5cf3a396445551fa3fee8e75d (diff)
downloadupstream-5cc94f2ac693c6e4ba118aef880a66d813ad6390.tar.gz
upstream-5cc94f2ac693c6e4ba118aef880a66d813ad6390.tar.bz2
upstream-5cc94f2ac693c6e4ba118aef880a66d813ad6390.zip
[package] firewall: revert accidential committed changes from r26805
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26806 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/firewall')
-rw-r--r--package/firewall/files/lib/core_interface.sh50
1 files changed, 11 insertions, 39 deletions
diff --git a/package/firewall/files/lib/core_interface.sh b/package/firewall/files/lib/core_interface.sh
index 5386292a48..bc9eb96dde 100644
--- a/package/firewall/files/lib/core_interface.sh
+++ b/package/firewall/files/lib/core_interface.sh
@@ -1,55 +1,27 @@
-# Copyright (C) 2009-2011 OpenWrt.org
+# Copyright (C) 2009-2010 OpenWrt.org
fw__uci_state_add() {
local var="$1"
local item="$2"
- local list="$(uci_get_state firewall core $var)"
- list=" ${list:+$list }"
-
- for item in $item; do
- case "$list" in
- "* $item *") continue;;
- *) list="$list$item ";;
- esac
- done
-
- list="${list% }"
- list="${list# }"
-
+ local val=" $(uci_get_state firewall core $var) "
+ val="${val// $item / }"
+ val="${val# }"
+ val="${val% }"
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() {
local var="$1"
local item="$2"
- echo "del[$item]"
-
- local list val
- for val in $(uci_get_state firewall core "$var" | sort -u); do
- list="${list:+$list }$val"
- done
-
- echo "list[$list]"
-
+ local val=" $(uci_get_state firewall core $var) "
+ val="${val// $item / }"
+ val="${val# }"
+ val="${val% }"
uci_revert_state firewall core $var
-
- [ -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"
- }
+ uci_set_state firewall core $var "$val"
}
fw_configure_interface() {