From ab38d27c24ceaae645b206f4dda3b40e4ac82f63 Mon Sep 17 00:00:00 2001 From: Mikhail Efremov Date: Fri, 17 Apr 2009 20:46:18 +0400 Subject: [PATCH 1/2] added openresolv support --- ppp-common/ppp/ip-down | 3 +++ ppp-common/ppp/ip-up | 15 ++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ppp-common/ppp/ip-down b/ppp-common/ppp/ip-down index 587637a..143ceb0 100755 --- a/ppp-common/ppp/ip-down +++ b/ppp-common/ppp/ip-down @@ -14,6 +14,7 @@ LOGDEVICE=$6 REALDEVICE=$1 +RESOLVCONF=/sbin/resolvconf export PATH=/sbin:/usr/sbin:/bin:/usr/bin @@ -22,6 +23,8 @@ if [ -f /etc/resolv.conf.save.$REALDEVICE ]; then rm -f /etc/resolv.conf.save.$REALDEVICE UC=/usr/sbin/update_chrooted [ -x $UC ] && $UC conf +else + [ -x "$RESOLVCONF" ] && $RESOLVCONF -fd $REALDEVICE fi for f in /etc/ppp/ip-down.d/*; do diff --git a/ppp-common/ppp/ip-up b/ppp-common/ppp/ip-up index 9d3f9c5..d0fcb40 100755 --- a/ppp-common/ppp/ip-up +++ b/ppp-common/ppp/ip-up @@ -31,6 +31,8 @@ LOGDEVICE=$6 REALDEVICE=$1 NS_IFUP=/etc/sysconfig/network-scripts/ifup-post N_C_S_CONFIG=/etc/sysconfig/network +RESOLVCONF=/sbin/resolvconf +PPP_RESOLV_CONF=/etc/ppp/resolv.conf export PATH=/sbin:/usr/sbin:/bin:/usr/bin @@ -116,13 +118,16 @@ modify_resolver() } if ! is_no "$RESOLV_MODS"; then - # check if kppp was here, don't touch /etc/resolv.conf then, just UC - grep -iqs '#.*ppp temp entry' /etc/resolv.conf || modify_resolver + if [ -x "$RESOLVCONF" ]; then + [ -f "$PPP_RESOLV_CONF" ] && $RESOLVCONF -a $REALDEVICE <$PPP_RESOLV_CONF + else + # check if kppp was here, don't touch /etc/resolv.conf then, just UC + grep -iqs '#.*ppp temp entry' /etc/resolv.conf || modify_resolver + UC=/usr/sbin/update_chrooted + [ -x $UC ] && $UC conf + fi fi -UC=/usr/sbin/update_chrooted -[ -x $UC ] && $UC conf - case $CONFMETHOD in etcnet) # Do nothing. /etc/net relies on updetach pppd option to continue configuring -- 1.6.3.1