From 2d1fef5e20ff4bfea125229631652d53a8d8243b Mon Sep 17 00:00:00 2001 From: Luis Enrique Pineda Date: Wed, 29 Sep 2021 13:02:37 -0500 Subject: [PATCH] Adding support for .mx domains --- check_domain_expiration.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/check_domain_expiration.sh b/check_domain_expiration.sh index dad59fd..e079585 100755 --- a/check_domain_expiration.sh +++ b/check_domain_expiration.sh @@ -427,6 +427,16 @@ check_domain() else EXP_DAYS=$(( ( $(date -ud ${EXDATE} +'%s') - $(date -ud `date +%Y-%m-%d` +'%s') )/60/60/24 )) fi + elif [ "$DTYPE" == "mx" ] + then + EXDATE_TMP=$(${WHOIS} "${1}" | ${AWK} '/Expiration Date:/ { print $3 }') + if [ -z "$EXDATE_TMP" ] + then + EXP_DAYS=NULL + else + EXDATE=`date -d"$EXDATE_TMP" +%Y-%m-%d` + EXP_DAYS=$(( ( $(date -ud ${EXDATE} +'%s') - $(date -ud `date +%Y-%m-%d` +'%s') )/60/60/24 )) + fi else echo "UNKNOWN - "$DTYPE" unsupported" exit 3