/[CCFs]/bin/ccfnotify
ViewVC logotype

Annotation of /bin/ccfnotify

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (hide annotations)
Wed Dec 7 14:48:45 2005 UTC (18 years, 11 months ago) by ccflib
Branch: MAIN
Changes since 1.4: +9 -9 lines
ccfnotify updated with new e-mail addresses

1 ccflib 1.1 #! /usr/local/bin/perl -w
2     #
3     # Giuseppe Vacanti (cosine science & computing)
4     #
5 ccflib 1.5 # $Id: ccfnotify,v 1.4 2003/11/26 13:57:42 ccflib Exp $
6 ccflib 1.1 #
7     require 5;
8     use FileHandle;
9     use Getopt::Std;
10     use strict;
11    
12     my %opts;
13 ccflib 1.2 getopts('t:d', \%opts); # -t development|release|public
14 ccflib 1.3 # -d => @names (see next line) were deleted
15 ccflib 1.1 my @names = @ARGV; # the rest of the command line contains the names of the
16     # CCF constituents
17    
18     die("Usage: -t development|release|public\n") if(not exists $opts{'t'});
19    
20     my $update = $opts{'t'};
21     my @to;
22     my $replyto;
23     my $subject;
24 ccflib 1.4 my $delete = $opts{'d'};
25    
26 ccflib 1.1 foreach($update){
27    
28     /^development$/ && do {
29     @to = qw/xmm-it sas-devel/;
30     $subject = "Update of the $update CCF area";
31 ccflib 1.5 $replyto = 'xmm-it@sciops.esa.int';
32 ccflib 1.1 next;
33     };
34    
35     /^release$/ && do {
36     @to = qw/xmm-it sas-devel/;
37     $subject = "Update of the $update CCF area";
38 ccflib 1.5 $replyto = 'xmm-it@sciops.esa.int';
39 ccflib 1.1 next;
40     };
41    
42     /^public$/ && do {
43     @to = qw/ccf xmm-it sas-devel/;
44     $subject = "XMM-Newton calibration update";
45 ccflib 1.5 $replyto = 'xmmhelp@sciops.esa.int';
46 ccflib 1.1 next;
47     };
48    
49     die("Wrong -t option: $update\n");
50     }
51    
52     exit(0) if(not @names);
53    
54 ccflib 1.3 # test
55 ccflib 1.4 #######@to = qw/gvacanti/;
56 ccflib 1.1
57     foreach(@to){
58     my $fh = new FileHandle "|/usr/lib/sendmail -t" or die ("$!\n");
59    
60 ccflib 1.5 $fh->print("From: ccflib\@sciops.esa.int
61 ccflib 1.1 Reply-To: $replyto
62 ccflib 1.5 To: $_\@sciops.esa.int
63 ccflib 1.1 Subject: $subject
64     ");
65    
66 ccflib 1.2 if($delete){
67 ccflib 1.4 $fh->print("\nThe following calibration constituents were deleted or moved to another directory:\n\n");
68 ccflib 1.2 } else {
69     $fh->print("\nThe following new calibration constituents are available:\n\n");
70     }
71 ccflib 1.1
72     foreach(@names){
73     $fh->print("$_\n");
74     }
75    
76     if($update eq "public"){
77     $fh->print('
78     For details and download instructions please refer to:
79    
80 ccflib 1.5 http://xmm.esac.esa.int/external/xmm_sw_cal/calib/
81     http://xmm.esac.esa.int/external/xmm_sw_cal/calib/rel_notes
82 ccflib 1.1
83     Best regards,
84    
85     The XMM-Newton Calibration Librarian
86 ccflib 1.5 xmmhelp@sciops.esa.int
87 ccflib 1.1
88     ');
89    
90     undef $fh;
91    
92     }
93    
94     }
95    
96    
97    
98    
99    

  ViewVC Help
Powered by ViewVC 1.1.27