projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[package] base-files: make ip matching in dns add/remove functions more explicit...
[openwrt.git]
/
package
/
base-files
/
files
/
lib
/
network
/
config.sh
diff --git
a/package/base-files/files/lib/network/config.sh
b/package/base-files/files/lib/network/config.sh
index
cf5b197
..
00e372a
100755
(executable)
--- a/
package/base-files/files/lib/network/config.sh
+++ b/
package/base-files/files/lib/network/config.sh
@@
-106,7
+106,7
@@
add_dns() {
local dns
local add
for dns in "$@"; do
local dns
local add
for dns in "$@"; do
- grep -qs
F "nameserver $dns
" /tmp/resolv.conf.auto || {
+ grep -qs
E "^nameserver ${dns//./\\.}$
" /tmp/resolv.conf.auto || {
add="${add:+$add }$dns"
echo "nameserver $dns" >> /tmp/resolv.conf.auto
}
add="${add:+$add }$dns"
echo "nameserver $dns" >> /tmp/resolv.conf.auto
}
@@
-126,7
+126,7
@@
remove_dns() {
[ -f /tmp/resolv.conf.auto ] && {
local dns=$(uci_get_state network "$cfg" resolv_dns)
for dns in $dns; do
[ -f /tmp/resolv.conf.auto ] && {
local dns=$(uci_get_state network "$cfg" resolv_dns)
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
}
@@
-261,9
+261,9
@@
setup_interface_static() {
esac
[ -z "$ipaddr" ] || $DEBUG ifconfig "$iface" "$ipaddr" netmask "$netmask" broadcast "${bcast:-+}"
esac
[ -z "$ipaddr" ] || $DEBUG ifconfig "$iface" "$ipaddr" netmask "$netmask" broadcast "${bcast:-+}"
- [ -z "$ip6addr" ] || $DEBUG ifconfig "$
iface
" add "$ip6addr"
+ [ -z "$ip6addr" ] || $DEBUG ifconfig "$
{iface%:*}
" add "$ip6addr"
[ -z "$gateway" ] || $DEBUG route add default gw "$gateway" ${metric:+metric $metric} dev "$iface"
[ -z "$gateway" ] || $DEBUG route add default gw "$gateway" ${metric:+metric $metric} dev "$iface"
- [ -z "$ip6gw" ] || $DEBUG route -A inet6 add default gw "$ip6gw" ${metric:+metric $metric} dev "$
iface
"
+ [ -z "$ip6gw" ] || $DEBUG route -A inet6 add default gw "$ip6gw" ${metric:+metric $metric} dev "$
{iface%:*}
"
[ -z "$dns" ] || add_dns "$config" $dns
config_get type "$config" TYPE
[ -z "$dns" ] || add_dns "$config" $dns
config_get type "$config" TYPE
This page took
0.038134 seconds
and
4
git commands to generate.