4 # From: clyne@niwot.scd.ucar.EDU (John Clyne)
5 # Date: Fri, 28 Feb 92 09:54:21 MST
7 # BTW, i wrote a perl script that is similar to 'nfpipe' except that in
8 # addition to logging to a file it provides a command line option for mailing
9 # change notices to a group of users. Obviously you probably wouldn't want
10 # to mail every change. But there may be certain directories that are commonly
11 # accessed by a group of users who would benefit from an email notice.
12 # Especially if they regularly beat on the same directory. Anyway if you
13 # think anyone would be interested here it is.
18 # National Center for Atmospheric Research
19 # PO 3000, Boulder, Colorado
21 # Date: Wed Feb 26 18:34:53 MST 1992
23 # Description: Tee standard input to mail a list of users and to
24 # a file. Used by CVS logging.
26 # Usage: mfpipe [-f file] [user@host...]
28 # Environment: CVSROOT
35 # Capture output to 'file'
38 $header = "Log Message:\n";
40 $mailcmd = "| mail -s 'CVS update notice'";
46 $cvsroot = $ENV{'CVSROOT'};
55 $users = "$users $arg";
60 $mailcmd = "$mailcmd $users";
61 open(MAIL
, $mailcmd) || die "Execing $mail: $!\n";
65 $logfile = "$cvsroot/LOG/$file";
66 open(FILE
, ">> $logfile") || die "Opening $logfile: $!\n";
69 print FILE
"$whoami $date--------BEGIN LOG ENTRY-------------\n" if ($logfile);
72 print FILE
$log if ($log && $logfile);
74 print FILE
$_ if ($logfile);
75 print MAIL
$_ if ($users);
77 $log = "log: " if ($_ eq $header);
81 die "Write failed" if $?
;
83 die "Mail failed" if $?
;