diff options
-rwxr-xr-x | sysconfig/network-scripts/ifup-post | 31 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-ppp | 3 |
2 files changed, 34 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/ifup-post b/sysconfig/network-scripts/ifup-post index 6ddf2167..cd5b0267 100755 --- a/sysconfig/network-scripts/ifup-post +++ b/sysconfig/network-scripts/ifup-post @@ -28,6 +28,37 @@ if [ -n "$NEEDHOSTNAME" -a "${DEVICE}" != lo -a "${DEVICETYPE}" != "ppp" -a "${D eval `/bin/ipcalc --silent --hostname ${IPADDR}` && set_hostname $HOSTNAME fi +if [ "$DEVICETYPE" = ppp -a "$PEERDNS" = yes -a -n "$DNS1" ] && + tr=`mktemp /tmp/resolv.XXXXXX` ; then + # replace only the first two nameserver lines; cannot count on awk + # and do not know if sed is capable of this... + current_replacement="$DNS1" + next_replacement="$DNS2" + while read answer < /etc/resolv.conf ; do + case $answer in + nameserver*) + if [ -n "$current_replacement" ] ; then + echo "nameserver $current_replacement" >> $tr + if [ -n "$next_replacement" ] ; then + current_replacement="$next_replacement" + next_replacement= + else + current_replacement= + fi + else + echo "$answer" >> $tr + fi + ;; + *) + echo "$answer" >> $tr + ;; + esac + done + # maintain permissions + cat $tr > /etc/resolv.conf + rm -f $tr +fi + # Notify programs that have requested notification do_netreport diff --git a/sysconfig/network-scripts/ifup-ppp b/sysconfig/network-scripts/ifup-ppp index 1727a778..ef5b0281 100755 --- a/sysconfig/network-scripts/ifup-ppp +++ b/sysconfig/network-scripts/ifup-ppp @@ -57,6 +57,9 @@ fi if [ "${DEFROUTE}" = yes ] ; then opts="$opts defaultroute" fi +if [ "${PEERDNS}" = yes ] ; then + opts="$opts usepeerdns" +fi if [ -n "${MRU}" ] ; then opts="$opts mru ${MRU}" fi |