View | Details | Raw Unified | Return to bug 7845
Collapse All | Expand All

(-)ip-up.ppp-common-0.3-alt1 (-2 / +5 lines)
Lines 60-67 Link Here
60
	[ -z "$MS_DNS1" ] || DNS1=$MS_DNS1
63
	[ -z "$MS_DNS1" ] || DNS1=$MS_DNS1
61
	[ -z "$MS_DNS2" ] || DNS2=$MS_DNS2
64
	[ -z "$MS_DNS2" ] || DNS2=$MS_DNS2
62
	local tr
65
	local tr
63
	if [ -n "$DNS1" ] && ! grep -qs "^nameserver $DNS1" /etc/resolv.conf &&
66
	tr=`mktemp /etc/resolv.conf.XXXXXX` || return 1
64
		tr=`mktemp /etc/resolv.conf.XXXXXX`; then
67
	if [ -n "$DNS1" ] && ! grep -qs "^nameserver $DNS1" /etc/resolv.conf
68
	then
65
		# replace only the first two nameserver lines; cannot count on awk
69
		# replace only the first two nameserver lines; cannot count on awk
66
		# and do not know if sed is capable of this...
70
		# and do not know if sed is capable of this...
67
		local current_replacement="$DNS1"
71
		local current_replacement="$DNS1"
Lines 102-107 Link Here
102
				echo "search $DOMAIN $search" >> $tr
106
				echo "search $DOMAIN $search" >> $tr
103
			fi
107
			fi
104
		done
108
		done
109
	else
110
		cat /etc/resolv.conf > $tr
105
	fi
111
	fi
106
	# backup resolv.conf
112
	# backup resolv.conf
107
	cp -af /etc/resolv.conf /etc/resolv.conf.save.$REALDEVICE
113
	cp -af /etc/resolv.conf /etc/resolv.conf.save.$REALDEVICE

Return to bug 7845