Skip to content

Commit 3bd3999

Browse files
committed
Update
1 parent 0ca2b3e commit 3bd3999

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

_do.cr

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ def check_domain(domain)
708708
return unless domain.count('.') == 1
709709
puts
710710
print("domain #{domain} expires on ")
711-
time = `whois #{domain}`
711+
times = `whois #{domain}`
712712
.split("\n")
713713
.select { |i| i.includes?("Expiry Date:") || i.includes?("Expiration Date:") || i.includes?("paid-till:") }
714714
.map { |i|
@@ -721,8 +721,8 @@ def check_domain(domain)
721721
}
722722
.select { |i| !i.nil? && !i.empty? && i[-1] == 'Z' }
723723
.map { |i| Time.parse_rfc3339(i.not_nil!) }
724-
.min
725-
print_expiration(time)
724+
725+
print_expiration(times.empty? ? nil : times.min)
726726
print(" ")
727727
print_dnssec_status(domain)
728728
end
@@ -1855,6 +1855,10 @@ def nonempty_exists?(path : Path)
18551855
end
18561856

18571857
def print_expiration(time)
1858+
if time.nil?
1859+
warn("unknown expiration")
1860+
return
1861+
end
18581862
now = Time.utc
18591863
if now < time
18601864
if now + 30.days >= time

0 commit comments

Comments
 (0)