mail log fine tuning

This commit is contained in:
Joe
2017-02-07 23:49:39 -06:00
parent f829028ddf
commit b4c98d097e

View File

@@ -4,7 +4,7 @@
testhost=webthink.net testhost=webthink.net
testuser=webmaster@${testhost} testuser=webmaster@${testhost}
logfile=~/checkMailQueryfail.log logfile=./checkMailQueryfail.log
mail=$1 mail=$1
hostPart=${mail/*@/} hostPart=${mail/*@/}
@@ -12,7 +12,7 @@ hostPart=${mail/*@/}
if [ hostPart != "localhost" ] if [ hostPart != "localhost" ]
then host=$(dig +short $hostPart MX | sort -n | head -n1 | cut -d " " -f 2) then host=$(dig +short $hostPart MX | sort -n | head -n1 | cut -d " " -f 2)
if [ -z ${host} ] if [ -z ${host} ]
then echo -e "{\"status\":\"err\", \"error\":\"Unknown mail hosti.\"}" then echo -e "{\"status\":\"err\", \"error\":\"Unknown mail host.\"}"
exit 1 exit 1
fi fi
else else