X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=bin%2FannounceEmail.pl;h=cf3dc499fe8b4aaf255d3359fef2e21961040e51;hb=dddc679d2bee64978cc936d70d6c05ae88969232;hp=906b22a70382ca448cee075974b238d7c20f2d40;hpb=1f5737d7c0b97ac29c72a9f0cd883bd6211edec9;p=clearscm.git diff --git a/bin/announceEmail.pl b/bin/announceEmail.pl index 906b22a..cf3dc49 100755 --- a/bin/announceEmail.pl +++ b/bin/announceEmail.pl @@ -40,7 +40,7 @@ $Date: 2019/04/04 13:40:10 $ Where: -usa|ge Print this usage -h|elp Detailed help - -v|erbose Verbose mode (Default: -verbose) + -v|erbose Verbose mode (Default: Not verbose) -de|bug Turn on debugging (Default: Off) -user|name User name to log in with (Default: $USER) @@ -141,17 +141,9 @@ sub interrupted { return; } # interrupted -sub Connect2IMAP; - -sub restart { - my $msg = "Re-establishing connection to $opts{imap} as $opts{username}"; - - $log->dbug($msg); - - Connect2IMAP; +sub restart; - goto MONITORMAIL; -} # restart +sub Connect2IMAP; $SIG{USR1} = \&interrupted; $SIG{USR2} = \&restart; @@ -279,6 +271,16 @@ sub MonitorMail() { return; } # MonitorMail +sub restart { + my $msg = "Re-establishing connection to $opts{imap} as $opts{username}"; + + $log->dbug($msg); + + Connect2IMAP; + + MonitorMail; +} # restart + END { # If $log is not yet defined then the exit is not unexpected if ($log) {