From bae5f8f7c6d72e25a0598da2f82f8ea1f10d8987 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 2 Sep 2022 09:58:45 -0400 Subject: fix domain searching scripts --- domain | 18 ++++++++++-------- domain-search | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/domain b/domain index 24e2d68..8ce1ccd 100755 --- a/domain +++ b/domain @@ -11,6 +11,8 @@ cli.add_argument("hostname", help="the name to search, sans the .tld") cli.add_argument( "-t", "--tlds", + # this doesn't do anything because my registry database only has .com, .net, + # and .edu help="list of tlds to search (default: 'com net')", nargs="+", default=["com", "net"], @@ -18,7 +20,7 @@ cli.add_argument( cli.add_argument( "--abbrev", help="search hostname abbrevs, like 'internationalization' => 'i18n'", - action='store_true' + action="store_true", ) args = cli.parse_args() @@ -35,10 +37,10 @@ for tld in args.tlds: c = args.hostname[-1] domains.append(f"{a}{b}{c}.{tld}") for domain in domains: - res = subprocess.run(["whois", domain], stdout=subprocess.PIPE).stdout.decode( - "utf-8" - ) - if re.search(regex, res, re.IGNORECASE): - print("ok:", domain) - else: - print("no:", domain) + res = subprocess.run(["whois", domain], stdout=subprocess.PIPE).stdout.decode( + "utf-8" + ) + if re.search(regex, res, re.IGNORECASE): + print("ok:", domain) + else: + print("no:", domain) diff --git a/domain-search b/domain-search index 622ba19..840cfe8 100755 --- a/domain-search +++ b/domain-search @@ -7,4 +7,4 @@ dict=$buildInputs/share/hunspell/en_US.dic # # grep the dictionary, strip weird '/SMY', then pass to my domain script # -grep $1 $dict | sed "s|\/.*$||g" | xargs -I % domain %.com +grep $1 $dict | sed "s|\/.*$||g" | xargs -I % domain % -- cgit v1.2.3