Re: /etc/profile

From: David Douthitt (ssrat_at_mailbag.com)
Date: 10/31/03


Date: Fri, 31 Oct 2003 10:14:28 -0600

On Fri, 31 Oct 2003 10:47:48 -0500, "Rob" <rshahamat@hotmail.com>
wrote:

>I need to be notified whenever a user log on to my solaris machine. I plan
>to put the following script in
> /etc/profile
>
>echo 'Subject: <ServerName>: ALERT - <username> login on:' `date` |
>/usr/sbin/sendmail -s <email address>
>
>Do you think if it works?

No, I think all the time ;-)

I think your idea will work...

>if so, right now I have some script in /etc/profile (i think its there by
>default), should I just add the above script into the end of the profile?
>
>What should i put for <username>? should I leave it as is?

How about this:

echo "Subject: $(hostname): ALERT - $USER login on: $(date)" | \
/usr/bin/sendmail -s root