summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-01-10 16:28:09 +0000
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-01-10 16:28:09 +0000
commitab2cda2f104e2692a6493eac779a03cda48533ff (patch)
treed65b3ca3e14b2db73d73de50426cbe49f40e9ccb /package
parent3afb594a0d635a30f239c88b9f7666d7f9011e0e (diff)
[package] ppp: process option dns if peerdns is off (#6474)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19093 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/ppp/files/ppp.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/package/ppp/files/ppp.sh b/package/ppp/files/ppp.sh
index 8dfdab7a0b..23fcb89ffd 100644
--- a/package/ppp/files/ppp.sh
+++ b/package/ppp/files/ppp.sh
@@ -51,9 +51,16 @@ start_pppd() {
interval="${keepalive##*[, ]}"
[ "$interval" != "$keepalive" ] || interval=5
- config_get_bool peerdns "$cfg" peerdns 1
- [ "$peerdns" -eq 1 ] && peerdns="usepeerdns" || peerdns=""
-
+ config_get_bool peerdns "$cfg" peerdns 1
+ [ "$peerdns" -eq 1 ] && peerdns="usepeerdns" || {
+ peerdns=""
+ config_get dns "$config" dns
+ for dns in $dns; do
+ grep -q "$dns" /tmp/resolv.conf.auto 2>/dev/null || \
+ echo "nameserver $dns" >> /tmp/resolv.conf.auto
+ done
+ }
+
config_get demand "$cfg" demand
[ -n "$demand" ] && echo "nameserver 1.1.1.1" > /tmp/resolv.conf.auto