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

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



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



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