diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2012-09-10 11:38:35 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2012-09-10 11:38:35 -0300 |
commit | 476e411f5f6149636668fa134db1437f7ffa3b39 (patch) | |
tree | 08c4a260e19f8886c749700f742cb8bc1e9d8ff5 /files | |
parent | aa0980b61d8bd4d2c37cfaf13f111dc5a6d0aa1d (diff) | |
download | puppet-nodo-476e411f5f6149636668fa134db1437f7ffa3b39.tar.gz puppet-nodo-476e411f5f6149636668fa134db1437f7ffa3b39.tar.bz2 |
Fixing output for .br domains when expiry date is not available on domain-check
Diffstat (limited to 'files')
-rwxr-xr-x | files/bin/domain-check | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/files/bin/domain-check b/files/bin/domain-check index 90d522f..ebefb6b 100755 --- a/files/bin/domain-check +++ b/files/bin/domain-check @@ -8,6 +8,10 @@ # # Revision History: # +# Version 1.11 +# Fixing mail program path -- Silvio Rhatto <rhatto at riseup dot net> +# Fixing output for .br domains when expiry date is not available -- Silvio Rhatto <rhatto at riseup dot net> +# # Version 1.10 # Do not add extra line on quiet mode -- Silvio Rhatto <rhatto at riseup dot net> # @@ -332,9 +336,14 @@ check_domain_status() #echo $DOMAINDATE # debug if [ "${TLDTYPE}" == "br" ]; # for .br domain then - # Convert the date to seconds - DOMAINJULIAN=`$DATE -d ${DOMAINDATE} "+%-m %-d %-Y"` - DOMAINJULIAN=`date2julian ${DOMAINJULIAN}` + # If registro.br outputs in reduced mode when query limits are + # reached, the whois server does not output expiry information. + if [ ! -z "${DOMAINDATE}" ]; + then + # Convert the date to seconds + DOMAINJULIAN=`$DATE -d ${DOMAINDATE} "+%-m %-d %-Y"` + DOMAINJULIAN=`date2julian ${DOMAINJULIAN}` + fi else # Whois data should be in the following format: "13-feb-2006" IFS="-" @@ -347,15 +356,24 @@ check_domain_status() fi # Get the diff between NOW and the expiration date - DOMAINDIFF=$(date_diff ${NOWJULIAN} ${DOMAINJULIAN}) + if [ ! -z "${DOMAINJULIAN}" ]; + then + DOMAINDIFF=$(date_diff ${NOWJULIAN} ${DOMAINJULIAN}) + else + # We have no information + DOMAINDIFF="undef" + fi - if [ "${TLDTYPE}" == "br" ]; # for .br domain + if [ "${TLDTYPE}" == "br" ] && [ ! -z "${DOMAINDATE}" ]; # for .br domain then # Fix domain date for displaying DOMAINDATE=`$DATE -d ${DOMAINDATE} +"%m-%b-%Y"` fi - if [ ${DOMAINDIFF} -lt 0 ] + if [ ${DOMAINDIFF} == 'undef' ]; + then + prints ${DOMAIN} "No info" "$?" "?" ${REGISTRAR} + elif [ ${DOMAINDIFF} -lt 0 ] then if [ "${ALARM}" = "TRUE" ] then |