Skip to content

Commit

Permalink
Merge pull request #36 from BuildTheRobots/add_us_in_space_rocks
Browse files Browse the repository at this point in the history
add 4 domains: rocks, space, in, us
  • Loading branch information
ewypych authored Jul 11, 2021
2 parents 79a2e9d + 0e14448 commit c7273ab
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ Supported Top-level Domains
* id
* dev
* io
* rocks
* space
* us
* in

Supported Whois Servers

Expand Down
38 changes: 38 additions & 0 deletions check_domain_expiration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,44 @@ check_domain()
else
EXP_DAYS=$(( ( $(date -ud ${EXDATE} +'%s') - $(date -ud `date +%Y-%m-%d` +'%s') )/60/60/24 ))
fi
elif [ "$DTYPE" == "space" ]
then
EXDATE_TMP=$(${WHOIS} "${1}" | ${AWK} '/Registry Expiry Date:/ { gsub("[:.]","-"); print $4 }' | cut -d 'T' -f1)
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
elif [ "$DTYPE" == "rocks" ]
then
EXDATE_TMP=$(${WHOIS} "${1}" | ${AWK} '/Registry Expiry Date:/ { gsub("[:.]","-"); print $4 }' | cut -d 'T' -f1)
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
elif [ "$DTYPE" == "us" ]
then
EXDATE=$(${WHOIS} -h www.whois.us "${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
elif [ "$DTYPE" == "in" ]
then
EXDATE=$(${WHOIS} -h whois.registry.in "${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

0 comments on commit c7273ab

Please sign in to comment.