From f3b41e75b183738206a46111556bf10d1e63aeed Mon Sep 17 00:00:00 2001 From: Matias De lellis Date: Thu, 15 May 2025 10:32:52 -0300 Subject: [PATCH] Add nic.ar patterns... It also trim spaces in the expiration which may be a problem with my pattern, but this shouldn't be a problem for the rest of the options. --- check_domain.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/check_domain.sh b/check_domain.sh index 8406716..85fb41c 100755 --- a/check_domain.sh +++ b/check_domain.sh @@ -447,6 +447,15 @@ get_expiration() { $0 ~ "expires: *" DATE_YYYY_MM_DD_DASH_HH_MM_SS_TZOFFSET {split($2, a, "-"); printf("%s-%s-%s", a[1], a[2], a[3]); exit} # FIXME: XXX: weak patterns + # .ar domains + # expire: 2025-12-22 00:00:00 + # (uses tabs between colon and date, we match tabs or spaces regardless) + $0 ~ "expire:[ \t]*" DATE_YYYY_MM_DD_HHMMSS { + sub(/^.*expire:[ \t]*/, "") + split($1, a, "-"); + printf("%s-%s-%s", a[1], a[2], a[3]); + } + # renewal: 31-March-2016 /renewal:/{split($2, a, "-"); printf("%s-%s-%s\n", a[3], month2moy(a[2]), a[1]); exit} @@ -481,6 +490,9 @@ else fi expiration=$(get_expiration "$outfile") +# Trim leading and trailing whitespace +expiration=$(echo "$expiration" | xargs) + [ -z "$expiration" ] && die "$STATE_UNKNOWN" "State: UNKNOWN ; Unable to figure out expiration date for $domain Domain." expseconds=$(date +%s --date="$expiration")