Skip to content

Commit

Permalink
Merge pull request #31 from 7srv/master
Browse files Browse the repository at this point in the history
Added zone club & server whois.drs.ua
  • Loading branch information
ewypych authored Mar 28, 2021
2 parents c0a9e83 + e5442d2 commit 7bc5f0d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ Supported Top-level Domains
* digital
* br
* it
* club

Supported Whois Servers

* whois.crazydomains.com
* whois.cloudflare.com
* whois.drs.ua, whois.pp.ua, whois.biz.ua

License
-------
Expand Down
21 changes: 20 additions & 1 deletion check_domain_expiration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,15 @@ check_domain()
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
elif [ "$DTYPE" == "club" ]
then
EXDATE=$(${WHOIS} -h whois.nic.club "${1}" | ${AWK} '/Registry Expiry Date:/ { gsub("[:.]","-"); print $4 }' | cut -d 'T' -f1)
if [ -z "$EXDATE" ]
then
EXP_DAYS=NULL
else
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 Expand Up @@ -377,6 +386,16 @@ check_domain_by_whois()
EXP_DAYS=$(( ( $(date -ud ${EXDATE} +'%s') - $(date -ud `date +%Y-%m-%d` +'%s') )/60/60/24 ))
fi

elif [ "$SERVER" == "whois.drs.ua" -o "$SERVER" == "whois.pp.ua" -o "$SERVER" == "whois.biz.ua" ]
then
EXDATE_TMP=$(${WHOIS} -h ${SERVER} "${DOMAIN}" | awk '/Expiration Date:/ { gsub("[:.]"," "); 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 - "$SERVER" unsupported"
Expand Down Expand Up @@ -448,7 +467,7 @@ else
echo "CRITICAL - ${DOMAIN}: domain has expired!"
exit 2
else
echo "UNKNOW - ${DOMAIN}: $EXP_DAYS"
echo "UNKNOWN - ${DOMAIN}: $EXP_DAYS"
exit 3
fi
fi

0 comments on commit 7bc5f0d

Please sign in to comment.