Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
res[domain.source.list] = [domain]
return res
+
+ def check(self, domain):
+ """
+ Returns the status of a domain
+ """
+ stmt = (
+ sqlmodel
+ .select(
+ checker.CheckerDomain.status,
+ )
+ .where(
+ checker.CheckerDomain.name == domain,
+ )
+ )
+
+ return self.db.fetch_one(stmt)
import pathlib
import rich.console
import rich.table
+import rich.text
import sys
import tempfile
"""
Searches for a domain name
"""
+ # Check if a domain is active
+ active = backend.check(args.domain)
+
+ # If the domain is dead, we show a warning
+ if active is False:
+ warning = rich.text.Text(
+ _("The domain '%s' seems to be dead") % args.domain,
+ style="bold red",
+ )
+ self.console.print(warning)
+
# Search!
lists = backend.search(args.domain)