Skip to content

Commit

Permalink
main.bash adds dontRun.txt if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclingzealot committed Aug 5, 2016
1 parent e1469a7 commit 47f5a76
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.bash
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ chmod 600 $log

#Check that the config file exists
if [[ ! -f "$configFile" ]] ; then
echo "I need a file at $configFile with an email address to warn"
echo "I need a file at $configFile with an email address to warn"
exit 1
fi

Expand All @@ -103,6 +103,10 @@ hostname=`hostname`
scratchFile=/tmp/dumuzid.scratch
echo > $scratchFile

if [[ ! -f $__dir/dontRun.txt ]]; then
touch $__dir/dontRun.txt
fi

sendAlert=0
echo > $scratchFile
for script in $__dir/*.bash ; do
Expand Down Expand Up @@ -131,7 +135,7 @@ if [ "$sendAlert" -eq "1" ] ; then
cat $scratchFile
if ~/bin/flagger.bash dumuzid 3600; then
cat $scratchFile | mail -s "$subject" $recipient
else
else
echo "Too early to send another notice"
fi
else
Expand Down

0 comments on commit 47f5a76

Please sign in to comment.