Am Sonntag, 17. August 2003 00:23 schrieb Steffen Barszus:

Well I know its bad style, but I pressed accidently on send :D

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

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

> 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

And the ip-down

#!/bin/bash
[.. 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 

chmod 0644 /etc/resolv.conf
------
shouldn't using cp instead of mv preserve the rights of /etc/resolv.conf ?

<snip>

Hope that wasn't posted to confusing ;)

Steffen

Reply via email to