Hi,

I've found some weird things in /etc/ppp/ip-up

1) what's this trick for PPP_TEMP_ENTRY ?
# for dynamic DNS support with gnome-ppp and kppp and draknet
if grep -i '#.*ppp temp entry' /etc/resolv.conf >& /dev/null ; then
    PPP_TEMP_ENTRY=`grep '#.*ppp temp entry' /etc/resolv.conf | \
       tail -1 | sed 's/.*ppp temp entry/# ppp temp entry/' `
else
    unset PPP_TEMP_ENTRY
fi

Why use this grep | tail | sed ? The result should always be "# ppp temp
entry"

2) kppp now writes temp entries in /etc/resolv.conf after /etc/ppp/ip-up
is run, gnome-ppp isn't supported anymore, and drakconnect uses kppp (it
even run it as root ...), so there is no need to check for "#.*ppp temp
entry" here ... 
"grep -i '#.*ppp temp entry' /etc/resolv.conf" will never match here.
So PPP_TEMP_ENTRY will never be set.

3) Since PPP_TEMP_ENTRY is always unset, the script never writes DNS in
/etc/resolv.conf
This is a problem when pppd or wvdial are used to establish the
connection.

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


I propose to drop all this "if grep -i '#.*ppp temp entry'
/etc/resolv.conf" and "if [ -n "$PPP_TEMP_ENTRY" ]" blocks and to
replace them with :

PPP_TEMP_ENTRY="# ppp temp entry"
[ -n "$DNS1" ] && \
    echo -e "nameserver $DNS1 $PPP_TEMP_ENTRY" >>/etc/resolv.conf
[ -n "$DNS2" ] && \
    echo -e "nameserver $DNS2 $PPP_TEMP_ENTRY" >> /etc/resolv.conf


Have I missed something ?
For dialup users, with the current ip-up script, only kppp sets dynamic
DNS in /etc/resolv.conf (it doesn't use the ip-up to do that) ...

-- 
Olivier Blin

Reply via email to