Skip to content

Commit

Permalink
Merge pull request #37 from caniculari/master
Browse files Browse the repository at this point in the history
Adding support for .mx domains
  • Loading branch information
ewypych authored Oct 1, 2021
2 parents c7273ab + 2d1fef5 commit 4cc0791
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions check_domain_expiration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4cc0791

Please sign in to comment.