in reply to Email printed message

#!/usr/local/bin/perl -w use strict; my @uptime = split //, `uptime`; my ($to,$from,$subject) = ('mail@list.com','sys@admin.com','ALERT : re +boot'); if ($uptime[2] > 1 ){ open(MAIL, "|/usr/sbin/sendmail -t"); print <<MAIL; To: $to From: $from Subject: $subject Server rebooted in the last 24 hours. MAIL close(MAIL); }
-Silent11

Replies are listed 'Best First'.
Re: Re: Email printed message
by talexb (Chancellor) on Mar 09, 2002 at 04:10 UTC
    Somehow it seems that it would make more sense if if ($uptime[2] > 1 ){ were if ($uptime[2] < 1 ){ instead.

    --t. alex

    "There was supposed to be an earth-shattering kaboom!" --Marvin the Martian