--- ip-up.ppp-common-0.3-alt1 2005-09-23 14:56:04 +0300 +++ ip-up 2005-09-23 12:26:05 +0300 @@ -60,8 +63,9 @@ [ -z "$MS_DNS1" ] || DNS1=$MS_DNS1 [ -z "$MS_DNS2" ] || DNS2=$MS_DNS2 local tr - if [ -n "$DNS1" ] && ! grep -qs "^nameserver $DNS1" /etc/resolv.conf && - tr=`mktemp /etc/resolv.conf.XXXXXX`; then + tr=`mktemp /etc/resolv.conf.XXXXXX` || return 1 + if [ -n "$DNS1" ] && ! grep -qs "^nameserver $DNS1" /etc/resolv.conf + then # replace only the first two nameserver lines; cannot count on awk # and do not know if sed is capable of this... local current_replacement="$DNS1" @@ -102,6 +106,8 @@ echo "search $DOMAIN $search" >> $tr fi done + else + cat /etc/resolv.conf > $tr fi # backup resolv.conf cp -af /etc/resolv.conf /etc/resolv.conf.save.$REALDEVICE