aboutsummaryrefslogtreecommitdiffstats
path: root/package/firewall/files/lib
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-03-30 20:29:17 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-03-30 20:29:17 +0000
commitaf82471525ca97845f0c1550a4203a15d9402995 (patch)
tree7bd93f8ac893bf7f8ff257b057a5a2b21963f81c /package/firewall/files/lib
parentd739594c8dd823d111a36652b93acf97c72f89ef (diff)
downloadupstream-af82471525ca97845f0c1550a4203a15d9402995.tar.gz
upstream-af82471525ca97845f0c1550a4203a15d9402995.tar.bz2
upstream-af82471525ca97845f0c1550a4203a15d9402995.zip
firewall: prevent duplicate values in interface state vars
SVN-Revision: 26382
Diffstat (limited to 'package/firewall/files/lib')
-rw-r--r--package/firewall/files/lib/core_interface.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/package/firewall/files/lib/core_interface.sh b/package/firewall/files/lib/core_interface.sh
index aff6641807..ed6a4b150f 100644
--- a/package/firewall/files/lib/core_interface.sh
+++ b/package/firewall/files/lib/core_interface.sh
@@ -4,7 +4,10 @@ fw__uci_state_add() {
local var="$1"
local item="$2"
- local val="$(uci_get_state firewall core $var)"
+ local val=" $(uci_get_state firewall core $var) "
+ val="${val// $item / }"
+ val="${val# }"
+ val="${val% }"
uci_set_state firewall core $var "${val:+$val }$item"
}