summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-02-17 13:16:53 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-02-17 13:16:53 -0300
commita2067fe4e3ac691234cf95379e14d358fcc9afc5 (patch)
tree22d151f39be02481743666c022945bde497d833c
parent8de1af16ccb41d347f8e431e5a1bd0ec38ff09b2 (diff)
downloadpuppet-domain_check-a2067fe4e3ac691234cf95379e14d358fcc9afc5.tar.gz
puppet-domain_check-a2067fe4e3ac691234cf95379e14d358fcc9afc5.tar.bz2
Another lookup fix for .org domains
-rwxr-xr-xfiles/domain-check14
1 files changed, 13 insertions, 1 deletions
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="-"