[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: New ip-up (Was: Re: REQ ip-up: run-parts /etc/ppp/up )



> Date: Fri, 17 Oct 1997 00:01:25 +0000 (   )
> From: Manong Dibos <jwalther@citytel.net>
> 
> I have this little ip-up.  I have found that many people NEVER get around
> to setting their hostname correctly, and hence things like "talk" and
> other little programs fail nicely, or are subtly wrong.  People, its
> important to set your hostname to what the rest of the internet sees you
> as.
> 
> Here is my script:  If you have comments of how to improve it, please let
> me know, but as it stands, could it be added to the debian distribution as
> the standard ip-up ?
> 
> #!/bin/sh
> # /etc/ppp/ip-up           by jwalther@citytel.net      Oct 16, 1997
> #
> # Sets the hostname of your machine to that returned by a DNS lookup on
> # your current IP.
> #
> # This strips your IP address from the output of ifconfig:
> #   ifconfig ppp0|awk '$0 ~ /inet/ {FS=":"; $0=$2; print $2}'
> #
> # This gets your HOSTNAME from the DNS lookup of your IP:
> #   nslookup|awk '$0 ~/^Name/ {print $2}'
> #
> # smail -q makes sure any pending mail is sent as soon as possible.
> 
> hostname \
> ` \
>     ifconfig ppp0|awk '$0 ~ /inet/ {FS=":"; $0=$2; print $2}'| \
>     nslookup|awk '$0 ~/^Name/ {print $2}' \
> `
> smail -q
> 
> # End of ip-up

1) ifconfig -i <name> restricts the output to the interface <name>,
   however, the interface is passed by ip-up in $1.

2) Note that $4 contains the local ip address, so the ifconfig part
   is not needed, just : nslookup $4 | ...etc.

3) Not every ip address has a reverse name lookup entry in the DNS, your
   script needs to check for this.

4) What about a host that has multiple ppp connections, are you going to
   change the hostname to the last one that has come up?  And, what is
   ppp-down going to do as the interfaces go down in random order?

5) smail -q : this should be `runq' or the sendmail equivalent that is
   supported both by smail & sendmail.

6) Is there anything wrong with a host name of `localhost'?  I tried to
   get somebody to `talk' with on irc today, but no one was willing to
   let me connect to them (via in.ntalkd, not irc), however, they seemed
   to be able to connect to me ok.

   I tried looking at the Host Requirements RFCs 1122, 1123, and 1127,
   but all I found was mention that RFC 822 deprecates the use of
   hostnames that are not fully qualified.  So, does anyone know what
   the hostname of a dial-up connection with dynamic ip address should be?

> On Thu, 16 Oct 1997, Philip Hands wrote:
> 
> > > The proper solution was suggested by folks on #Debian: have 
> > > a directory for scripts and run-parts it from ip-up.  
> > > FWIW I have set it up here and can e-mail it -- if anyone 
> > > (esp. Philip) wants to have look.
> > 
> > Please bung me a copy.
> > 
> > It's been on my TODO list for a while, but things have been rather hectic of late (people keep wanting to pay me for my time -- most irritating ;-)
> > 
> > Cheers, Phil.

I like the run-parts idea, just remember that each script needs to be
invoked with the arguments of $1 to $6 from /etc/ppp/ip-{up,down} .

-- 
Jeff Sheinberg  <jeffsh@erols.com>


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: