Updated announceEmail.pl
[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     /usr/local/bin/setsound.sh 35
12     sleep 60
13     killall -USR2 announceEmail.pl
14     sleep 60
15     killall -USR2 announceEmail.pl
16     ;;
17 esac