summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-03-13 11:43:24 +0100
committerFlorian Pritz <bluewind@xinu.at>2018-03-13 11:43:24 +0100
commitcee29c5772c0f0df05fbc6deba9eae620edc4cda (patch)
treeed22f81c532077c203f3bace9fb0e100d46ef631
parente7ac4c0958d6507ad902ca08a13b0321e59dae81 (diff)
downloadarch-mirror-tools-cee29c5772c0f0df05fbc6deba9eae620edc4cda.tar.gz
arch-mirror-tools-cee29c5772c0f0df05fbc6deba9eae620edc4cda.tar.xz
generate-mirror-mail.pl: Add multi-issue template
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xbin/generate-mirror-mail.pl26
1 files changed, 22 insertions, 4 deletions
diff --git a/bin/generate-mirror-mail.pl b/bin/generate-mirror-mail.pl
index 4b31eb6..83142f5 100755
--- a/bin/generate-mirror-mail.pl
+++ b/bin/generate-mirror-mail.pl
@@ -62,6 +62,23 @@ Thanks,
{$mail_from_name}
',
},
+ 'multiple-issues' => {
+ 'subject' => '[{$mirror_name}] Multiple issues with your Arch Linux mirror',
+ 'template' => 'Hi,
+
+We are seeing multiple issues with your Arch Linux mirror {$mirror_name}
+{$mirror_url}
+
+- We are unable to reach your mirror{$OUT = " via ".join(", ", @{$connection_failed{protocols}}) if @{$connection_failed{protocols}} > 0;}:
+{$connection_failed{mirror_urls}}
+
+- Your mirror seems to be out of sync since {$out_of_sync{last_sync}}:
+{$out_of_sync{mirror_urls}}
+
+Thanks,
+{$mail_from_name}
+',
+ },
);
my $Config = Config::Tiny->new();
@@ -186,12 +203,13 @@ while (<STDIN>) {
}
- if (@out_of_sync) {
+ if (@out_of_sync and @connection_failed) {
+ send_template_mail($to, $templates{"multiple-issues"}{"subject"}, $templates{"multiple-issues"}{"template"}, \%values);
+ $sent_mail = 1;
+ } elsif (@out_of_sync) {
send_template_mail($to, $templates{"out-of-sync"}{"subject"}, $templates{"out-of-sync"}{"template"}, \%values);
$sent_mail = 1;
- }
-
- if (@connection_failed) {
+ } elsif (@connection_failed) {
send_template_mail($to, $templates{"connection-failed"}{"subject"}, $templates{"connection-failed"}{"template"}, \%values);
$sent_mail = 1;
}