From a2067fe4e3ac691234cf95379e14d358fcc9afc5 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 17 Feb 2014 13:16:53 -0300 Subject: Another lookup fix for .org domains --- files/domain-check | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/files/domain-check b/files/domain-check index b2df60b..2342bc2 100755 --- a/files/domain-check +++ b/files/domain-check @@ -8,6 +8,9 @@ # # Revision History: # +# Version 1.13 +# Another lookup fix for .org domains. +# # Version 1.12 # Fix lookup for .org domains. # @@ -308,7 +311,7 @@ check_domain_status() # for .in, .info, .org domains if [ "${TLDTYPE}" == "org" ]; then - DOMAINDATE=`cat ${WHOIS_TMP} | ${AWK} '/Registry Expiry Date:/ { print $4 }' | cut -d':' -f2` + DOMAINDATE=`cat ${WHOIS_TMP} | ${AWK} '/Registry Expiry Date:/ { print $4 }' | cut -d':' -f1 | sed -e 's/T.*$//'` elif [ "${TLDTYPE}" == "in" -o "${TLDTYPE}" == "info" ]; then DOMAINDATE=`cat ${WHOIS_TMP} | ${AWK} '/Expiration Date:/ { print $2 }' | cut -d':' -f2` @@ -361,6 +364,15 @@ check_domain_status() DOMAINJULIAN=`$DATE -d ${DOMAINDATE} "+%-m %-d %-Y"` DOMAINJULIAN=`date2julian ${DOMAINJULIAN}` fi + elif [ "${TLDTYPE}" == "org" ]; # for .org domain + then + # Whois data should be in the following format: "2006-02-13" + YEAR=$(echo $DOMAINDATE | cut -d '-' -f 1) + MONTH=$(echo $DOMAINDATE | cut -d '-' -f 2) + DAY=$(echo $DOMAINDATE | cut -d '-' -f 3) + + # Convert the date to seconds + DOMAINJULIAN=$(date2julian ${MONTH} ${DAY} ${YEAR}) else # Whois data should be in the following format: "13-feb-2006" IFS="-" -- cgit v1.2.3