diff --git a/checkMail.sh b/checkMail.sh index 67ac1c7..bac50fc 100755 --- a/checkMail.sh +++ b/checkMail.sh @@ -1,10 +1,12 @@ #!/bin/bash -#set -x +set -x testhost=webthink.net testuser=webmaster@${testhost} -logfile=./checkMailQueryfail.log # +logfile=./checkMailQueryfail.log +#echo -e "{\"status\":\"err\", \"path\":\"`pwd`\"}" +#exit 0 mail=$1 hostPart=${mail/*@/} @@ -12,7 +14,8 @@ hostPart=${mail/*@/} if [ hostPart != "localhost" ] then host=$(dig +short $hostPart MX | sort -n | head -n1 | cut -d " " -f 2) if [ -z ${host} ] -then echo -e "{\"status\":\"err\", \"error\":\"Unknown mail host.\"}" +then echo "`date` - ERR : " $mail ": Unknown Host" >> $logfile +echo -e "{\"status\":\"err\", \"error\":\"Unknown mail host.\"}" exit 1 fi else