aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-01-10 16:28:09 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-01-10 16:28:09 +0000
commitb28f438a37183e012e6a7b591adb9552bb9b78c0 (patch)
treea6ed77ed187070242bf4bcd5cc3382d13e98554b
parent7d5f49afc1f9a2183a209c14e5fda43e6613a420 (diff)
downloadupstream-b28f438a37183e012e6a7b591adb9552bb9b78c0.tar.gz
upstream-b28f438a37183e012e6a7b591adb9552bb9b78c0.tar.bz2
upstream-b28f438a37183e012e6a7b591adb9552bb9b78c0.zip
ppp: process option dns if peerdns is off (#6474)
SVN-Revision: 19093
-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