> > PPP_TEMP_ENTRY=`grep '#.*ppp temp entry' /etc/resolv.conf | \
> > tail -1 | sed 's/.*ppp temp entry/# ppp temp entry/' `
> > ----
> > PPP_TEMP_ENTRY="# ppp temp entry", written in a style that it could
> > win the most useless use of sed award.
> It doesn't make more then what I said in any case, so take the sed,
> the obsolete tail -1 and the grep out and ready.
agree one more time :)
> > ----
> > else
> > unset PPP_TEMP_ENTRY
> > fi
>
> Are there cases there a dynamic DNS don't want to be used ? which ?
> From what I have read on the net, if the option usepeerdns is used the
> variable USEPEERDNS is set, so this could be used, am I right ?
According pppd man :
The addresses supplied by the peer (if any) are passed to the
/etc/ppp/ip-up script in the environment variables DNS1 and DNS2.
So why not use DNS1 and DNS2 variables as my original proposal does ?
> And the ip-down
[.. snip ...]
> mv -f /etc/resolv.conf /etc/resolv.conf.tmp
> cat /etc/resolv.conf.tmp | awk '{if(!/nameserver .* # ppp temp
> entry.*/) print $0}' > /etc/resolv.conf
> ------
> print all lines that does not contain the pattern
> nameserver ........... # ppp temp entry
> to /etc/resolv.conf
But why keep the "# ppp temp entry" lines ?
Why not use if(!/.*# ppp temp entry.*/) print $0} and remove the
irrelevant stuff in /etc/ppp/ip-up ?
> chmod 0644 /etc/resolv.conf
> ------
> shouldn't using cp instead of mv preserve the rights of
> /etc/resolv.conf ?
right :)
> Hope that wasn't posted to confusing ;)
no, that's ok :)
--
Olivier Blin