Date: Sun, 11 Apr 2010 00:41:01 -0700 From: Doug Hardie <bc979@lafn.org> To: Jos Chrispijn <kernel@webrz.net> Cc: freebsd-questions@freebsd.org Subject: Re: Auto update Message-ID: <F02E5989-F279-4059-9858-EF36FDA726FC@lafn.org> In-Reply-To: <4BC168D8.7080900@webrz.net> References: <4BC168D8.7080900@webrz.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 10 April 2010, at 23:14, Jos Chrispijn wrote:
> Can someone tell me if there is a way of generating an email on the moment that someone logs in to my FreeBSD server? The mail part (phpmail) will be easy; I don't know yet how to trigger and pass parameter to this script or redirect info to a file (that I then send by email). Thanks.
A cheesy way to do that is to use a popen ("tail -f /var/log/auth.log", "r") and then read that. It will give you every login regardless of ssh, telnet etc. You could then generate the emails from that. I have no idea just how resource intensive this might be. You would also have to ensure it got started by rc during boot.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F02E5989-F279-4059-9858-EF36FDA726FC>
