diff options
-rwxr-xr-x | bin/generate-mirror-mail.pl | 26 |
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; } |