mirror of
https://github.com/a-stoyanov/zabbix-domain-expiry.git
synced 2025-12-14 18:32:30 +00:00
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.
This commit is contained in:
parent
9b8e1279fb
commit
f3b41e75b1
1 changed files with 12 additions and 0 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue