diff options
author | Ben Sima <ben@bsima.me> | 2022-09-02 09:58:45 -0400 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2022-09-02 09:58:45 -0400 |
commit | bae5f8f7c6d72e25a0598da2f82f8ea1f10d8987 (patch) | |
tree | 0fa9d215706cc2d849a72d41311bc6b8fa375e74 | |
parent | 5bfee664988b2235f5b2becece0372e8b3e99f6c (diff) |
fix domain searching scripts
-rwxr-xr-x | domain | 18 | ||||
-rwxr-xr-x | domain-search | 2 |
2 files changed, 11 insertions, 9 deletions
@@ -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 % |