Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for .hu #45

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions check_domain_expiration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ALARM=10
# binaries path
WHOIS="/usr/bin/whois"
AWK="/usr/bin/awk"
CURL="/usr/bin/curl"

# Main check function
check_domain()
Expand Down Expand Up @@ -477,6 +478,16 @@ 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" = "hu" ]
then
EXDATE_TMP=$(${CURL} -s -X POST https://info.domain.hu/webwhois/hu/domain/$1 | awk 'f{print;f=0} /Lej.*rati id/{f=1}'
neszt marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down