mirror of https://github.com/hak5/openwrt.git
firewall: prevent duplicate values in interface state vars
SVN-Revision: 26382lede-17.01
parent
d739594c8d
commit
af82471525
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
PKG_NAME:=firewall
|
PKG_NAME:=firewall
|
||||||
|
|
||||||
PKG_VERSION:=2
|
PKG_VERSION:=2
|
||||||
PKG_RELEASE:=23
|
PKG_RELEASE:=24
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,10 @@ fw__uci_state_add() {
|
||||||
local var="$1"
|
local var="$1"
|
||||||
local item="$2"
|
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"
|
uci_set_state firewall core $var "${val:+$val }$item"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue