Re: IP address as email subject?




----- Original Message -----
From: "Mark B" <mark.benavides@xxxxxxxxx>
Newsgroups: comp.unix.sco.misc
To: <distro@xxxxxxx>
Sent: Friday, April 28, 2006 2:01 AM
Subject: IP address as email subject?


Good morning!

I've cobbled together the following to strip my WAN IP from a website,
and wonder what I need to do to make the IP the subject of an email.

lynx -dump ipchicken.com | sed -n 9p | sed "s/^[ ^t]*//" >file.out <
mail -s "contents of file out" no.spam.at@xxxxxxxxx

I'm assuming I either need to either:
1: create a variable and redirect that into subject, or
2: grab contents of file.out and import it into subject.

thanks in advance,

Unix rookie Mark

You could use a dynamic dns service updater client run from a cron job.
http://www.aljex.com/bkw/sco/#ez-ipupdate
And that's only necessary if the router for that site doesn't have a dyn-dns
client built in.
Instead of having IP's mailed to you repeatedly.

Note though that the updater client needs to be used from within a script
that keeps track of the previous IP and compares it to the current IP and
doesn't try to update if they still match, because if you don't dyndns.org
will shut the account off for abuse.

Ask me how I know. :)

the answer to your question though was:

read MYIP <file.out
mail -s "$MYIP" you@xxxxxxx

Brian K. White -- brian@xxxxxxxxx -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO FreeBSD #callahans Satriani Filk!


Brian K. White -- brian@xxxxxxxxx -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO FreeBSD #callahans Satriani Filk!

.



Relevant Pages