Merge branch 'master' of https://github.com/adefaria/clearscm
[clearscm.git] / bin / announceEmail
1 #!/bin/bash
2 case $1 in
3   post)
4     # If we send the USR2 signal before the network comes back up then 
5     # announceEmail.pl will die trying to re-establish its connection to the
6     # IMAP server. So instead we use this cheap method of sleeping for a while
7     # as the network should be back by then. A better method would be to poll
8     # looking for the network to come back up but that's tricker to implement.
9     #
10     # Seems like one kill is not enough. Try 2 - spaced a minute apart
11     sleep 60
12     killall -USR2 announceEmail.pl
13     sleep 60
14     killall -USR2 announceEmail.pl
15     ;;
16 esac