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