From 8035b104670574186ee09c14a478ef9f89f43570 Mon Sep 17 00:00:00 2001 From: Julien Lamarche Date: Tue, 18 Oct 2016 14:03:40 -0400 Subject: [PATCH] made dumuzid able to print onscreen --- main.bash | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/main.bash b/main.bash index d9f8188..12f21e5 100755 --- a/main.bash +++ b/main.bash @@ -133,10 +133,17 @@ if [ "$sendAlert" -eq "1" ] ; then echo >> $scratchFile echo "Running on `hostname` by user `whoami`" >> $scratchFile cat $scratchFile - if ~/bin/flagger.bash dumuzid 3600; then - cat $scratchFile | mail -s "$subject" $recipient + if [[ "recipient" != 'onscreen' ]]; then + if ~/bin/flagger.bash dumuzid 3600; then + cat $scratchFile | mail -s "$subject" $recipient + else + echo "Too early to send another notice" + fi + elif [[ "$recipient" == 'onscreen' ]]; then + notify-send `cat $scratchFile` else - echo "Too early to send another notice" + echo "Unrecognized recipient" + exit 1 fi else ~/bin/flagger.bash dumuzid -1