Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Sep 1998 11:35:41 -0700 (PDT)
From:      "Eric J. Schwertfeger" <ejs@bfd.com>
To:        Frank Griffith <frankg@idfw.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Mail ifconfig -a output to myself
Message-ID:  <Pine.BSF.4.01.9809161131370.22812-100000@harlie.bfd.com>
In-Reply-To: <000e01bde199$aa691060$0200a8c0@fast1.dfw.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 16 Sep 1998, Frank Griffith wrote:

> I want to run the command ifconfig -a  and have the output 
> of this command be mailed to myself via the Internet. So,
> I typed this command line:
> 
>     ifconfig -a > mail my_emailaddress@my_domain.com

close.  > redirects to a file, | redirects to the stdin of another program

     ifconfig -a > mail my_emailaddress@my_domain.com

should work, though I havent tested it.

> Of course this did not work. Can someone tell me the 
> proper syntax for this?
> 
> BTW: I want to do this so I can keep up with my IP on my 
> computer at home while I'm away from the house. I can't 
> afford a static IP account just yet and my only method for 
> reaching my home server from my office is to write down 
> the IP before I leave and hope it doesn't have to reconnect 
> before I get to work. Does anyone know what I'm talking 
> about.? Any good scripts you can share? Do I need to 
> use cron?

if you're using pppd, then use the script /etc/ppp/ip-up, you'll find that
the IP address is one of the parameters passed to it, so you don't even
have to use ifconfig, you could just

	echo ADDRESS=$4 | mail youraddress@work

though you'll have to check to see which parameter is the local address,
and change $4 to that number.

The only way I know to do this with ppp (user space) is with the cron
file, though I'm sure that someone can set up a better way of doing it, I
just don't use ppp enough to know the ins and outs.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.01.9809161131370.22812-100000>