On Wed, 28 Jul 1999 [EMAIL PROTECTED] wrote:
> So I am about to modify my "ip-up" script to do the following: do
> an nslookup on the IP # I get sent, in order to get the name of the
> "machine" that I've been given, and then insert this machine name into
> /var/qmail/control/defaulthost. I have tested this "by hand" e.g.
> getting the machine-name and doing a "telnet freebsd.org smtp" with
> EHLO etc, and it works.
I use this snippet on my ip-up. I'm sure it's not the cleanest or elegant
solution but it works. :-)
It runs on linux but since you seem to use freebsd your mileage may vary,
if ifconfig has a different output.
LOCAL_ADDR=`/sbin/ifconfig | /usr/bin/grep P-t-P | /bin/cut -f 2 -d ':' |
/usr/bin/awk '{print $1}'`
/usr/bin/nslookup $LOCAL_ADDR | /usr/bin/awk '/^Name:/ { print $2}' >
/var/qmail/control/helohost
# this is necessary because my provider is not a very reliable and
# sometimes, their DNS is down. On these occasions there is nothing one
# can do.
# Acctually i could, i could finger a machine which holds the people that
# is connected through PPP, but that is just too much trouble.
if [ -s /var/qmail/control/helohost ]; then
chmod 644 /var/qmail/control/helohost
else
rm -f /var/qmail/control/helohost
fi
Hope this helps.
--
Tiago Pascoal ([EMAIL PROTECTED]) FAX : +351-1-7273394
Politicamente incorrecto, e membro (nao muito) proeminente da geracao rasca.
Recem empossado (engajado) cidadao da republica das bananas.
The Unspeakable Law:
As soon as you mention something;
if it is good, it goes away.
if it is bad, it happens.