Am Samstag, 16. August 2003 23:50 schrieb Olivier Blin:
> > That means that all lines "nameserver ...........  # ppp temp entry"
> > are deleted. The rule is not applied to a line there only "# ppp temp
> > entry" is in. That means the DNS are written in /etc/resolv.conf if #
> > ppp temp entry is in /etc/resolv.conf
>
> [snip]
>
> > Try writing a line
> > # ppp temp entry
> > in /etc/resolv.conf . Then ip-up should write the dynamic nameserver
> > in /etc/resolv.conf
>
> I already know this trick, but the user shouldn't have to do this !!
> Why should we write "# ppp temp entry" in /etc/resolv.conf to get it to
> work ?
> This doesn't work out of the box !
> And the user don't have to reverse ingeneer scripts ...

No he shouldn't. drakconnect should put it in /etc/resolv.conf, but I must 
admit that I don't see a case where it wouldn't be usefull

> > If you wish I can fully pots ip-up /ip-down and explain what I think
> > what happens.
>
s/pots/post/

> Yes, that would help me :)

Well I guess it isn't need anymore, since your point it should be allways 
done, not only if # ppp temp entry is in /etc/resolv.conf. I would basically 
say that you want that drakconnect does write this line for modem too in 
/etc/resolv.conf 

Ok , here we go 
----
#!/bin/bash
# This file should not be modified -- make local changes to
# /etc/ppp/ip-up.local instead
----
here as supposed, an /etc/ppp/ip-up.d/ dir would be nice and more clean. 
----
PATH=/sbin:/usr/sbin:/bin:/usr/bin
export PATH

LOGDEVICE=$6
----
Where is this documented ? I haven't found anything about it. 

----
REALDEVICE=$1

export PATH=/sbin:/usr/sbin:/bin:/usr/bin

if [ -x /usr/sbin/sendmail ];then
    /usr/sbin/sendmail -q 2>/dev/null >/dev/null &
fi
----
===> /etc/ppp/ip-up.d/ 

----
# for dynamic DNS support with gnome-ppp and kppp and draknet
if grep -i '#.*ppp temp entry' /etc/resolv.conf >& /dev/null ; then
----
If there is a line containing # ppp temp entry 

----
    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. 

----
else
    unset PPP_TEMP_ENTRY
fi
if [ -n "$PPP_TEMP_ENTRY" ]; then
    [ -n "$DNS1" ] && \
        echo -e "nameserver $DNS1 $PPP_TEMP_ENTRY" >> /etc/resolv.conf
    [ -n "$DNS2" ] && \
        echo -e "nameserver $DNS2 $PPP_TEMP_ENTRY" >> /etc/resolv.conf
fi

[ -f /etc/sysconfig/network-scripts/ifcfg-${LOGDEVICE} ] && 
/etc/sysconfig/network-scripts/ifup-post ifcfg-${LOGDEVICE}
----
[ -x /etc/ppp/ip-up.local ] && /etc/ppp/ip-up.local "$@"

exit 0



Reply via email to