From 7e54c23f5b9b239ace8a04496f390e8b651b2e24 Mon Sep 17 00:00:00 2001 From: Daniel Oosterwijk Date: Tue, 2 Nov 2021 10:10:55 +1300 Subject: [PATCH 1/2] Add support for .fm and .xyz --- check_domain_expiration.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/check_domain_expiration.sh b/check_domain_expiration.sh index e079585..0e81f7a 100755 --- a/check_domain_expiration.sh +++ b/check_domain_expiration.sh @@ -437,6 +437,26 @@ 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" == "fm" ] + then + EXDATE_TMP=$(${WHOIS} -h whois.nic.fm "${1}" | ${AWK} '/Registry Expiry Date:/ { print $4 }' | cut -c 1-16) + 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" == "xyz" ] + then + EXDATE_TMP=$(${WHOIS} -h whois.nic.xyz "${1}" | ${AWK} '/Registry Expiry Date:/ { print $4 }' | cut -c 1-16) + 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 - "$DTYPE" unsupported" exit 3 From 31e7bf4688f3c1a56c72dd5ee995a258c3d2d49b Mon Sep 17 00:00:00 2001 From: Daniel Oosterwijk Date: Tue, 2 Nov 2021 10:13:47 +1300 Subject: [PATCH 2/2] Update README with .fm and .xyz --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ee77367..c153b85 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,8 @@ Supported Top-level Domains * space * us * in +* fm +* xyz Supported Whois Servers