boot up notification

Jerry McAllister jerrymc at clunix.cl.msu.edu
Fri Jan 14 14:01:13 PST 2005


> 
> I would like one of my servers to send me an email when
> it boots. I envision a script in rc.conf to do this.
> 
> Is there an easier way, or an automatic system which can do this?

Put a little script in /usr/local/etc/rc.d

name it something like /usr/local/etc/rc.d/bootmail.sh
In it, put something like:

#!/bin/sh
 echo "Coming Up at: `date`" | /usr/bin/mail -s 'Boot Notice' your at email.addr
exit 0

Make sure it has execute permission and it will run at boot time.

It will send you an Email message complete with the date
when it boots.   Note the _back_ single quotes around date.

////jerry

> 
> Jim
> 


More information about the freebsd-questions mailing list