base-files: make ip matching in dns add/remove functions more explicit, avoids overmatching pairs like 1.2.3.35 and 1.2.3.3
SVN-Revision: 28291
This commit is contained in:
parent
896847d18c
commit
41838f4585
2 changed files with 3 additions and 3 deletions
|
@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
|
||||||
PKG_NAME:=base-files
|
PKG_NAME:=base-files
|
||||||
PKG_RELEASE:=79
|
PKG_RELEASE:=80
|
||||||
|
|
||||||
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
|
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
|
||||||
PKG_BUILD_DEPENDS:=opkg/host
|
PKG_BUILD_DEPENDS:=opkg/host
|
||||||
|
|
|
@ -106,7 +106,7 @@ add_dns() {
|
||||||
local dns
|
local dns
|
||||||
local add
|
local add
|
||||||
for dns in "$@"; do
|
for dns in "$@"; do
|
||||||
grep -qsF "nameserver $dns" /tmp/resolv.conf.auto || {
|
grep -qsE "^nameserver ${dns//./\\.}$" /tmp/resolv.conf.auto || {
|
||||||
add="${add:+$add }$dns"
|
add="${add:+$add }$dns"
|
||||||
echo "nameserver $dns" >> /tmp/resolv.conf.auto
|
echo "nameserver $dns" >> /tmp/resolv.conf.auto
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ remove_dns() {
|
||||||
[ -f /tmp/resolv.conf.auto ] && {
|
[ -f /tmp/resolv.conf.auto ] && {
|
||||||
local dns=$(uci_get_state network "$cfg" resolv_dns)
|
local dns=$(uci_get_state network "$cfg" resolv_dns)
|
||||||
for dns in $dns; do
|
for dns in $dns; do
|
||||||
sed -i -e "/^nameserver $dns$/d" /tmp/resolv.conf.auto
|
sed -i -e "/^nameserver ${dns//./\\.}$/d" /tmp/resolv.conf.auto
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue