projects
/
clearscm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed bug in setbg
[clearscm.git]
/
bin
/
announceEmail.pl
diff --git
a/bin/announceEmail.pl
b/bin/announceEmail.pl
index
3b9d52a
..
cb6667b
100755
(executable)
--- a/
bin/announceEmail.pl
+++ b/
bin/announceEmail.pl
@@
-75,9
+75,10
@@
use warnings;
use FindBin;
use Getopt::Long;
use FindBin;
use Getopt::Long;
-use Pod::Usage;
use Mail::IMAPTalk;
use MIME::Base64;
use Mail::IMAPTalk;
use MIME::Base64;
+use Pod::Usage;
+use Proc::ProcessTable;
use lib "$FindBin::Bin/../lib";
use lib "$FindBin::Bin/../lib";
@@
-89,6
+90,16
@@
use Utils;
local $0 = "$FindBin::Script " . join ' ', @ARGV;
local $0 = "$FindBin::Script " . join ' ', @ARGV;
+my $processes = Proc::ProcessTable->new;
+
+for my $process (@{$processes->table}) {
+ if ($process->cmndline eq $0 and $process->pid != $$) {
+ verbose "$FindBin::Script already running";
+
+ exit 0;
+ } # if
+} # for
+
my $defaultIMAPServer = 'defaria.com';
my $IMAP;
my %unseen;
my $defaultIMAPServer = 'defaria.com';
my $IMAP;
my %unseen;
@@
-252,9
+263,7
@@
sub MonitorMail() {
my $greeting = $greetings[int rand $#greetings];
my $msg = "$greeting from $from... $subject";
my $greeting = $greetings[int rand $#greetings];
my $msg = "$greeting from $from... $subject";
- $msg =~ s/\"/\\"/g;
-
- my $hour = (localtime)[2];
+ my $hour = (localtime)[2];
# Only announce if after 6 Am. Note this will announce up until
# midnight but that's ok. I want midnight to 6 Am as silent time.
# Only announce if after 6 Am. Note this will announce up until
# midnight but that's ok. I want midnight to 6 Am as silent time.