aboutsummaryrefslogtreecommitdiff
path: root/files/bin
diff options
context:
space:
mode:
Diffstat (limited to 'files/bin')
-rwxr-xr-xfiles/bin/domain-check30
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