Skip to content

Commit

Permalink
Added support for .co.jp domain.
Browse files Browse the repository at this point in the history
Updated script version to 2.65.

Signed-off-by: vlad11 <[email protected]>
  • Loading branch information
click0 committed Feb 11, 2023
1 parent cfe3db7 commit bc6299f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
25 changes: 20 additions & 5 deletions domain-check-2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
# Author: Matty < matty91 at gmail dot com >
# Co-author: Vladislav V. Prodan <github.com/click0>
#
# Current Version: 2.64
# Last Updated: 18-Jan-2023
# Current Version: 2.65
# Last Updated: 11-Feb-2023
#
# Revision History:
#
# Version 2.65
# Added support for .co.jp domain -- Vladislav V. Prodan <github.com/click0>
#
# Version 2.64
# Removed whitespace escape for awk.
# Fixed registrar output formatting for some domain zones.
Expand Down Expand Up @@ -515,7 +518,7 @@ check_domain_status()
then
TLDTYPE=$(echo ${DOMAIN} | ${AWK} -F. '{print tolower($(NF-1));}')
fi
if [ "${TLDTYPE}" == "ua" -o "${TLDTYPE}" == "pl" -o "${TLDTYPE}" == "br" ];
if [ "${TLDTYPE}" == "ua" -o "${TLDTYPE}" == "pl" -o "${TLDTYPE}" == "br" -o "${TLDTYPE}" == "jp" ];
then
local SUBTLDTYPE=$(echo ${DOMAIN} | ${AWK} -F. '{print tolower($(NF-1)"."$(NF));}')
fi
Expand Down Expand Up @@ -558,9 +561,12 @@ check_domain_status()
elif [ "${TLDTYPE}" == "me" ];
then
REGISTRAR=`${AWK} -F: '/Registrar:/ && $2 != "" { REGISTRAR=substr($2,2,23) } END { print REGISTRAR }' ${WHOIS_TMP}`
elif [ "${TLDTYPE}" == "jp" ];
elif [ "${TLDTYPE}" == "jp" ] && [ "${SUBTLDTYPE}" != "co.jp" ];
then
REGISTRAR=`${AWK} -F\] '/\[Registrant\]/ && $2 != "" { REGISTRAR=substr($2,21,40) } END { print REGISTRAR }' ${WHOIS_TMP} | ${TR} -d "\r"`
elif [ "${SUBTLDTYPE}" == "co.jp" ];
then
REGISTRAR=`${AWK} -F\] '/\[Organization\]/ && $2 != "" { REGISTRAR=substr($2,16,40) } END { print REGISTRAR }' ${WHOIS_TMP} | ${TR} -d "\r"`
# no longer shows Registrar name, so will use Status #
elif [ "${TLDTYPE}" == "md" ];
then
Expand Down Expand Up @@ -698,7 +704,7 @@ check_domain_status()
then
DOMAINDATE=`${AWK} '/Renewal date:/ || /Expiry date:/ { print $3 }' ${WHOIS_TMP}`

elif [ "${TLDTYPE}" == "jp" ]; # for .jp fixed @click0 2019/06/26
elif [ "${TLDTYPE}" == "jp" ] && [ "${SUBTLDTYPE}" != "co.jp" ];
then
tdomdate=`${AWK} -F] '/\[有効期限\]|\[Expires on\]/ { print $2 }' ${WHOIS_TMP} | ${TR} -d " \r"`
tyear=`echo ${tdomdate} | ${CUT} -d'/' -f1`
Expand All @@ -707,6 +713,15 @@ check_domain_status()
tday=`echo ${tdomdate} | ${CUT} -d'/' -f3`
DOMAINDATE=`echo $tday-$tmonth-$tyear`

elif [ "${SUBTLDTYPE}" == "co.jp" ];
then
tdomdate=`${AWK} '/\[状態\]/ { print $NF }' ${WHOIS_TMP} | ${TR} -d "() \r"`
tyear=`echo ${tdomdate} | ${CUT} -d'/' -f1`
tmon=`echo ${tdomdate} | ${CUT} -d'/' -f2`
tmonth=$(getmonth_number ${tmon})
tday=`echo ${tdomdate} | ${CUT} -d'/' -f3`
DOMAINDATE=`echo $tday-$tmonth-$tyear`

elif [ "${TLDTYPE}" == "ru" -o "${TLDTYPE}" == "su" ]; # for .ru and .su 2014/11/13
then
tdomdate=`${AWK} '/paid-till:/ { print $2 }' ${WHOIS_TMP}`
Expand Down
1 change: 1 addition & 0 deletions domain-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,4 @@ google.business
google.photo
google.com.ar
amazon.bm
google.co.jp

0 comments on commit bc6299f

Please sign in to comment.