From owner-freebsd-questions Wed Sep 16 11:36:34 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA06540 for freebsd-questions-outgoing; Wed, 16 Sep 1998 11:36:34 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from horst.bfd.com (horst.bfd.com [12.9.219.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA06508 for ; Wed, 16 Sep 1998 11:36:21 -0700 (PDT) (envelope-from ejs@bfd.com) Received: from HARLIE.bfd.com (bastion.bfd.com [12.9.219.14]) by horst.bfd.com (8.9.1/8.9.1) with SMTP id LAA14788; Wed, 16 Sep 1998 11:35:42 -0700 (PDT) Date: Wed, 16 Sep 1998 11:35:41 -0700 (PDT) From: "Eric J. Schwertfeger" To: Frank Griffith cc: freebsd-questions@FreeBSD.ORG Subject: Re: Mail ifconfig -a output to myself In-Reply-To: <000e01bde199$aa691060$0200a8c0@fast1.dfw.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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