/[CCFs]/bin/ccfnotify
ViewVC logotype

Annotation of /bin/ccfnotify

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (hide annotations)
Tue Aug 28 13:07:26 2018 UTC (6 years, 2 months ago) by ccflib
Branch: MAIN
Changes since 1.11: +5 -5 lines
Replaced xmm-it by ccf@sciops.esa.int due to former mailman list has been deleted

1 ccflib 1.11 #! /xdata/ccflib/perl5/perlbrew/perls/perl-5.18.4/bin/perl -w
2 ccflib 1.1 #
3 ccflib 1.7 # After several changes in mail gtwy at ESAC, the different mail addresses
4 ccflib 1.9 # have been changed.
5 ccflib 1.7 #
6     # Mailman mail distribution lists have to be of the form: list@xmm.esac.esa.int
7     #
8     # $replyto for xmm-it, sas-devel should now go to : eduardo.ojero@esa.it
9     #
10 ccflib 1.12 # $Id: ccfnotify,v 1.11 2017/02/21 10:58:55 ccflib Exp $
11 ccflib 1.1 #
12     require 5;
13     use FileHandle;
14     use Getopt::Std;
15     use strict;
16    
17     my %opts;
18 ccflib 1.2 getopts('t:d', \%opts); # -t development|release|public
19 ccflib 1.3 # -d => @names (see next line) were deleted
20 ccflib 1.1 my @names = @ARGV; # the rest of the command line contains the names of the
21     # CCF constituents
22    
23     die("Usage: -t development|release|public\n") if(not exists $opts{'t'});
24    
25     my $update = $opts{'t'};
26     my @to;
27     my $replyto;
28     my $subject;
29 ccflib 1.4 my $delete = $opts{'d'};
30    
31 ccflib 1.1 foreach($update){
32    
33     /^development$/ && do {
34 ccflib 1.12 @to = qw/sas-devel\@xmm.esac.esa.int/;
35 ccflib 1.1 $subject = "Update of the $update CCF area";
36 ccflib 1.7 $replyto = 'eduardo.ojero@esa.int';
37 ccflib 1.1 next;
38     };
39    
40     /^release$/ && do {
41 ccflib 1.12 @to = qw/ccf\@sciops.esa.int sas-devel\@xmm.esac.esa.int/;
42 ccflib 1.1 $subject = "Update of the $update CCF area";
43 ccflib 1.7 $replyto = 'eduardo.ojero@esa.int';
44 ccflib 1.1 next;
45     };
46    
47     /^public$/ && do {
48 ccflib 1.12 @to = qw/ccf\@sciops.esa.int sas-devel\@xmm.esac.esa.int/;
49 ccflib 1.1 $subject = "XMM-Newton calibration update";
50 ccflib 1.10 $replyto = 'eduardo.ojero@esa.int';
51 ccflib 1.1 next;
52     };
53    
54     die("Wrong -t option: $update\n");
55     }
56    
57     exit(0) if(not @names);
58    
59 ccflib 1.7 #
60     # notice that sendmail is in /usr/lib not in /usr/bin or /usr/sbin
61 ccflib 1.1
62     foreach(@to){
63     my $fh = new FileHandle "|/usr/lib/sendmail -t" or die ("$!\n");
64    
65 ccflib 1.7 $fh->print("From: ccflib\@xmm.esac.esa.int
66 ccflib 1.1 Reply-To: $replyto
67 ccflib 1.12 To: $_
68 ccflib 1.1 Subject: $subject
69     ");
70    
71 ccflib 1.2 if($delete){
72 ccflib 1.4 $fh->print("\nThe following calibration constituents were deleted or moved to another directory:\n\n");
73 ccflib 1.2 } else {
74     $fh->print("\nThe following new calibration constituents are available:\n\n");
75     }
76 ccflib 1.1
77     foreach(@names){
78     $fh->print("$_\n");
79     }
80    
81     if($update eq "public"){
82     $fh->print('
83     For details and download instructions please refer to:
84    
85 ccflib 1.11 https://www.cosmos.esa.int/web/xmm-newton/calibration
86     https://www.cosmos.esa.int/web/xmm-newton/ccf-release-notes
87 ccflib 1.1
88     Best regards,
89    
90     The XMM-Newton Calibration Librarian
91 ccflib 1.10 ---------------------------------------------------------------
92     Please reply to: ');
93     $fh->print(" $replyto\n");
94 ccflib 1.1
95     undef $fh;
96    
97     }
98    
99     }

  ViewVC Help
Powered by ViewVC 1.1.27