On Monday 20 April, Marcus Brinkmann <[EMAIL PROTECTED]> writes:

> 
> You can install pppconfig. It is not in the base disks, though. I will
> suggest that to the boot floppy maintainer.

I did. Much better, thanks !

> I will suggest pppconfig in the base disks. I'm not sure about the
> nameserver stuff, but I will suggest it, too. Not however, that only the
> first three entries are ever used (check the man page). And everybody is
> encouraged to use the nameserver of his local provider.

Yes. I do not think that the nameserver is any more precious than the
name of the provider or the phone number - though I suppose it is shared
between all providers.

I actually use xisp (which, by the way has broken dependencies - how
do I file a bug report ?) which edits resolv.conf every call.

I attach a modified version of pppconfig that includes nameserver
configuration that *will* be needed on a boot disk.

Cheers,    Andy!

--
Andy Rabagliati  .  [EMAIL PROTECTED]  .  http://www.wizzy.com/andyr/

--- pppconfig   Mon Apr 20 16:32:00 1998
+++ pppconfig.sh        Mon Apr 20 17:54:40 1998
@@ -7,8 +7,9 @@
 
 # The author is John Hasler <[EMAIL PROTECTED]>. It is based on work by
 # Richard G. Roberto and Bruce Perens.
+# resolv.conf additions by Andy Rabagliati <[EMAIL PROTECTED]>
 
-version="pppconfig 1.0"
+version="pppconfig 1.1"
 # set -x
 umask 027
 BACKTITLE="Debian GNU/Linux PPP Configuration Utility"
@@ -22,9 +23,6 @@
 
 # Set defaults.
 atdx=ATDT
-route=defaultroute
-ipdefault=noipdefault
-modeminit=ATZ
 
 ispport=/dev/ttyS1
 ispspeed=115200
@@ -234,9 +232,6 @@
        "Defaultroute"  "Enable or disable default route" \\
        "Ipdefault"     "Set IP addresses" \\
         "Method"        "Authentication Method (e.g., PAP)" \\
-EOF
-            [ -f /etc/resolv.conf ] && {
-               cat >> $TempFile <<EOF
        "Nameserver"    "Set Nameserver" \\
 EOF
            [ $ispauth = "chat" ] && {
@@ -553,6 +548,7 @@
     GetName             # Get the name of this provider.
     CHATFILE=$ETC/chatscripts/$provider
     OPTIONFILE=$ETC/ppp/peers/$provider
+    RESOLV=$ETC/resolv.conf
     doFiles get         # Get variables now that we know the name
     mkMenu method      # calls doOps with appropriate method arg
                        # this starts the process of collecting all other
@@ -582,10 +578,10 @@
 doFiles () {
     case $1 in
     get)
-       if grep -qs ""This file was generated by pppconfig" /etc/resolv.conf
+       if grep -qs "This file was generated by pppconfig" $RESOLV
        # We generated this file last time
        then
-          ispnameserver=`grep -s pppconfig_nameserver /etc/resolv.conf | cut 
-f 1 -d ' ' -`
+          ispnameserver=`grep -s pppconfig_nameserver $RESOLV | cut -f 2 -d ' 
' -`
        fi
        if grep -qs "This file was generated by pppconfig" "$OPTIONFILE"
        # We put options in this file last time.
@@ -629,13 +625,28 @@
        fi
        ;;
     put)
-        if grep -qs "This file was generated by pppconfig" /etc/resolv.conf
+        if grep -qs "This file was generated by pppconfig" $RESOLV
        then
           # Edit the file
           sed -e "/#pppconfig_nameserver/c\\
-nameserver     $ispnameserver
-" /etc/resolv.conf > $SedFile
-cat $SedFile > /etc/resolv.conf
+nameserver $ispnameserver      #pppconfig_nameserver
+" $RESOLV > $SedFile
+cat $SedFile > $RESOLV
+        else
+           if [ -s $RESOLV ]
+           # There is something here, but none of it is ours.
+           then
+               # Move it to a safe place.
+               mv $RESOLV $RESOLV.old
+           fi
+           # And create a new file.
+           touch $RESOLV
+           cat >$RESOLV <<EOF
+# This file was generated by pppconfig.  You can edit the following lines
+# but please do not delete lines or the change the comments or you will
+# confuse pppconfig.
+nameserver $ispnameserver       #pppconfig_nameserver
+EOF
        fi
        if grep -qs "This file was generated by pppconfig" "$OPTIONFILE"
        # Evidently we've been here before.
@@ -842,7 +853,7 @@
        return
        ;;
     Nameserver)
-       nameserver="`inputBox \
+       ispnameserver="`inputBox \
 "In order to convert from names of sites, like ftp.debian.org, to IP
 addresses, like 192.168.0.4, your computer needs a Nameserver. Your
 ISP should have provided you with one, or two. It MUST be entered
@@ -964,7 +975,7 @@
        doOps Speed
        doOps Modeminit
        doOps Number
-       [ ! -f /etc/resolv.conf ] && doOps Nameserver
+       doOps Nameserver
        return
        ;;
     esac

Reply via email to